From 3f0de9e73792d5c9afa41c2886c89ff22b95307e Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.oliveiramaroneze@cea.fr>
Date: Wed, 13 Mar 2019 18:48:25 +0100
Subject: [PATCH] [tests] refactoring of sparecode tests

---
 tests/sparecode/bts324.i     |  6 +++---
 tests/sparecode/bts324_bis.i |  6 +++---
 tests/sparecode/bts334.i     |  6 +++---
 tests/sparecode/bts927.i     |  4 ++--
 tests/sparecode/calls.i      |  4 ++--
 tests/sparecode/dead_code.i  |  4 ++--
 tests/sparecode/glob_decls.i |  6 +++---
 tests/sparecode/intra.i      | 10 +++++-----
 tests/sparecode/issue_157.i  |  2 +-
 tests/sparecode/params.i     |  4 ++--
 tests/sparecode/se.i         |  2 +-
 tests/sparecode/test_config  |  1 +
 tests/sparecode/top.i        |  6 +++---
 13 files changed, 31 insertions(+), 30 deletions(-)
 create mode 100644 tests/sparecode/test_config

diff --git a/tests/sparecode/bts324.i b/tests/sparecode/bts324.i
index 10be411858c..c2cf07e2d27 100644
--- a/tests/sparecode/bts324.i
+++ b/tests/sparecode/bts324.i
@@ -1,7 +1,7 @@
 /* run.config
-   OPT: -sparecode-analysis -eva-show-progress -sparecode-debug 1 -journal-disable
-   OPT: -sparecode-analysis -eva-show-progress -sparecode-debug 1 -main main_bis -journal-disable
-   OPT: -sparecode-analysis -eva-show-progress -sparecode-debug 1 -main main_ter -journal-disable
+   STDOPT: +"-sparecode-analysis"
+   STDOPT: +"-sparecode-analysis -main main_bis"
+   STDOPT: +"-sparecode-analysis -main main_ter"
 
 */
 
diff --git a/tests/sparecode/bts324_bis.i b/tests/sparecode/bts324_bis.i
index 911010398dd..73050a55cfd 100644
--- a/tests/sparecode/bts324_bis.i
+++ b/tests/sparecode/bts324_bis.i
@@ -1,7 +1,7 @@
 /* run.config
-   OPT: -sparecode-analysis -eva-show-progress -sparecode-debug 1 -journal-disable
-   OPT: -sparecode-analysis -eva-show-progress -sparecode-debug 1 -main main_bis -journal-disable
-   OPT: -sparecode-analysis -eva-show-progress -sparecode-debug 1 -sparecode-no-annot -journal-disable
+   STDOPT: +"-sparecode-analysis"
+   STDOPT: +"-sparecode-analysis -main main_bis"
+   STDOPT: +"-sparecode-analysis -sparecode-no-annot"
 */
 
 int ki[2], k ;
diff --git a/tests/sparecode/bts334.i b/tests/sparecode/bts334.i
index 171f62f180f..f6af16f8c93 100644
--- a/tests/sparecode/bts334.i
+++ b/tests/sparecode/bts334.i
@@ -1,7 +1,7 @@
 /*run.config
- OPT: -main main_init -sparecode-analysis -eva-show-progress -sparecode-no-annot  -journal-disable
- OPT: -main main_init -eva-show-progress -slice-pragma loop_body -journal-disable -then-on 'Slicing export' -print
- OPT: -main main_init -eva-show-progress -slice-pragma loop_body -calldeps -journal-disable -then-on 'Slicing export' -print
+ STDOPT: +"-sparecode-debug 0 -main main_init -sparecode-analysis -sparecode-no-annot "
+ STDOPT: +"-sparecode-debug 0 -main main_init -slice-pragma loop_body -then-on 'Slicing export' -print"
+ STDOPT: +"-sparecode-debug 0 -main main_init -slice-pragma loop_body -calldeps -then-on 'Slicing export' -print"
  */
 int kf ;
 int k[2] ;
diff --git a/tests/sparecode/bts927.i b/tests/sparecode/bts927.i
index da1d3904f9e..883a5ed539c 100644
--- a/tests/sparecode/bts927.i
+++ b/tests/sparecode/bts927.i
@@ -1,6 +1,6 @@
 /*  run.config
- OPT: -no-warn-signed-overflow -sparecode -eva-show-progress
- OPT: -warn-signed-overflow -sparecode -eva-show-progress
+ STDOPT: +"-sparecode-debug 0 -no-warn-signed-overflow -sparecode"
+ STDOPT: +"-sparecode-debug 0 -warn-signed-overflow -sparecode"
 */
 
 /* The purpose of these tests is to check if the conditions are removed
diff --git a/tests/sparecode/calls.i b/tests/sparecode/calls.i
index 48b0856afe0..91773f1b22e 100644
--- a/tests/sparecode/calls.i
+++ b/tests/sparecode/calls.i
@@ -1,6 +1,6 @@
 /* run.config
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -journal-disable
-   OPT: -slicing-level 2 -slice-return main -eva-show-progress -journal-disable -then-on 'Slicing export' -print
+   STDOPT: +"-sparecode-analysis"
+   STDOPT: +"-slicing-level 2 -slice-return main -then-on 'Slicing export' -print"
 */
 int G;
 
diff --git a/tests/sparecode/dead_code.i b/tests/sparecode/dead_code.i
index 3f8966d815d..327e62941ab 100644
--- a/tests/sparecode/dead_code.i
+++ b/tests/sparecode/dead_code.i
@@ -1,6 +1,6 @@
 /* run.config
-   OPT: -sparecode-debug 1 -sparecode -eva-show-progress -journal-disable
-   OPT: -slicing-level 2 -slice-return main -eva-show-progress -journal-disable -then-on 'Slicing export' -print
+   STDOPT: +"-sparecode"
+   STDOPT: +"-slicing-level 2 -slice-return main -then-on 'Slicing export' -print"
 */
 
 int main (void) {
diff --git a/tests/sparecode/glob_decls.i b/tests/sparecode/glob_decls.i
index f8f2da144f9..abdf205de22 100644
--- a/tests/sparecode/glob_decls.i
+++ b/tests/sparecode/glob_decls.i
@@ -1,7 +1,7 @@
 /* run.config
- OPT: -lib-entry -journal-disable -sparecode-debug 1 -sparecode-analysis -eva-show-progress 
- OPT: -lib-entry -slice-pragma main -slice-return main -eva-show-progress -journal-disable -then-on 'Slicing export' -print
- OPT: -journal-disable -sparecode-debug 1 -sparecode-rm-unused-globals
+ STDOPT: +"-lib-entry -sparecode-analysis "
+ STDOPT: +"-lib-entry -slice-pragma main -slice-return main -then-on 'Slicing export' -print"
+ STDOPT: +"-sparecode-rm-unused-globals"
 */
 
 // can be removed
diff --git a/tests/sparecode/intra.i b/tests/sparecode/intra.i
index 444aa11a381..65316cbe60a 100644
--- a/tests/sparecode/intra.i
+++ b/tests/sparecode/intra.i
@@ -1,9 +1,9 @@
 /* run.config
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -journal-disable
-   OPT: -eva-show-progress -slicing-level 2 -slice-return main -journal-disable -then-last -print
-   OPT: -main main2 -sparecode-analysis -eva-show-progress -journal-disable
-   OPT: -main main2 -slice-return main2 -eva-show-progress -journal-disable -then-last -print
-   OPT: -main main2 -slice-return main2 -eva-show-progress -slice-assert f10 -journal-disable -then-last -print
+   STDOPT: +"-sparecode-analysis"
+   STDOPT: +"-sparecode-debug 0 -slicing-level 2 -slice-return main -then-last -print"
+   STDOPT: +"-sparecode-debug 0 -main main2 -sparecode-analysis"
+   STDOPT: +"-sparecode-debug 0 -main main2 -slice-return main2 -then-last -print"
+   STDOPT: +"-sparecode-debug 0 -main main2 -slice-return main2 -slice-assert f10 -then-last -print"
 */
 
 /* Waiting for results such as:
diff --git a/tests/sparecode/issue_157.i b/tests/sparecode/issue_157.i
index 7bdc05ad32b..930b3686c9a 100644
--- a/tests/sparecode/issue_157.i
+++ b/tests/sparecode/issue_157.i
@@ -1,5 +1,5 @@
 /* run.config
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -journal-disable
+   STDOPT: +"-sparecode-analysis"
 */
 
 int f() {
diff --git a/tests/sparecode/params.i b/tests/sparecode/params.i
index 33c0142f48e..26bb415eefc 100644
--- a/tests/sparecode/params.i
+++ b/tests/sparecode/params.i
@@ -1,6 +1,6 @@
 /* run.config
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -journal-disable
-   OPT: -eva-show-progress -slicing-level 2 -slice-return main -journal-disable -then-last -print -eva-show-progress
+   STDOPT: +"-sparecode-analysis"
+   STDOPT: +"-slicing-level 2 -slice-return main -then-last -print"
 */
 
 /* This is an example from #529. 'y' in [main1] should be visible to get a
diff --git a/tests/sparecode/se.i b/tests/sparecode/se.i
index 8f7b0fe6760..3a7460e9595 100644
--- a/tests/sparecode/se.i
+++ b/tests/sparecode/se.i
@@ -1,5 +1,5 @@
 /* run.config
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -lib-entry -main Se -journal-disable
+   STDOPT: +"-sparecode-analysis -lib-entry -main Se"
 */
 int glob;
 
diff --git a/tests/sparecode/test_config b/tests/sparecode/test_config
new file mode 100644
index 00000000000..f46bc3e3975
--- /dev/null
+++ b/tests/sparecode/test_config
@@ -0,0 +1 @@
+OPT: -journal-disable -eva-show-progress -sparecode-debug 1
diff --git a/tests/sparecode/top.i b/tests/sparecode/top.i
index 40f7cc9d0b6..d15706cc6ce 100644
--- a/tests/sparecode/top.i
+++ b/tests/sparecode/top.i
@@ -1,7 +1,7 @@
 /* run.config
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -journal-disable -main main_top
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -journal-disable -main main_call_top
-   OPT: -sparecode-debug 1 -sparecode-analysis -eva-show-progress -journal-disable -main main_top_not_used
+   STDOPT: +"-sparecode-analysis -main main_top"
+   STDOPT: +"-sparecode-analysis -main main_call_top"
+   STDOPT: +"-sparecode-analysis -main main_top_not_used"
 */
 
 void print (int x);
-- 
GitLab