From 85d2fb50581666f1b2ecfc0ed653c945d50ac49e Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.oliveiramaroneze@cea.fr>
Date: Wed, 13 Mar 2019 19:20:28 +0100
Subject: [PATCH] [tests] refactoring of saveload tests

---
 tests/saveload/basic.i              | 10 +++++-----
 tests/saveload/bool.c               |  4 ++--
 tests/saveload/callbacks.i          |  2 +-
 tests/saveload/deps.i               | 10 +++++-----
 tests/saveload/isset.c              |  8 ++++----
 tests/saveload/load_one.i           |  2 +-
 tests/saveload/multi_project.i      |  2 +-
 tests/saveload/segfault_datatypes.i |  4 ++--
 tests/saveload/sparecode.i          |  2 +-
 tests/saveload/test_config          |  1 +
 10 files changed, 23 insertions(+), 22 deletions(-)
 create mode 100644 tests/saveload/test_config

diff --git a/tests/saveload/basic.i b/tests/saveload/basic.i
index e0d5d8f8b74..e08f72217af 100644
--- a/tests/saveload/basic.i
+++ b/tests/saveload/basic.i
@@ -2,14 +2,14 @@
    EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs
    EXECNOW: LOG basic_sav.res LOG basic_sav.err BIN basic.sav @frama-c@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -eva -out -input -deps -eva-show-progress ./@PTEST_DIR@/@PTEST_NAME@.i -save ./tests/saveload/result/basic.sav > ./tests/saveload/result/basic_sav.res 2> ./tests/saveload/result/basic_sav.err
    EXECNOW: LOG basic_sav.1.res LOG basic_sav.1.err BIN basic.1.sav ./bin/toplevel.opt -save ./tests/saveload/result/basic.1.sav @PTEST_DIR@/@PTEST_NAME@.i -eva -out -input -deps -eva-show-progress > ./tests/saveload/result/basic_sav.1.res 2> ./tests/saveload/result/basic_sav.1.err
-   OPT: -load ./tests/saveload/result/basic.sav -eva -out -input -deps -journal-disable
+   STDOPT: +"-load ./tests/saveload/result/basic.sav -eva -out -input -deps -journal-disable"
    CMD: @frama-c@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs
-   OPT: -load ./tests/saveload/result/basic.1.sav -eva -out -input -deps -journal-disable -print
-   OPT: -load ./tests/saveload/result/basic.1.sav -eva -out -input -deps -journal-disable
+   STDOPT: +"-load ./tests/saveload/result/basic.1.sav -eva -out -input -deps -journal-disable -print"
+   STDOPT: +"-load ./tests/saveload/result/basic.1.sav -eva -out -input -deps -journal-disable"
    EXECNOW: make -s @PTEST_DIR@/status.cmxs
    EXECNOW: LOG status_sav.res LOG status_sav.err BIN status.sav @frama-c@ -load-module @PTEST_DIR@/status -save ./tests/saveload/result/status.sav @PTEST_DIR@/@PTEST_NAME@.i > ./tests/saveload/result/status_sav.res 2> ./tests/saveload/result/status_sav.err
-   OPT: -load-module @PTEST_DIR@/status -load ./tests/saveload/result/status.sav
-   OPT: -load ./tests/saveload/result/status.sav
+   STDOPT: +"-load-module @PTEST_DIR@/status -load ./tests/saveload/result/status.sav"
+   STDOPT: +"-load ./tests/saveload/result/status.sav"
 */
 
 int main() {
diff --git a/tests/saveload/bool.c b/tests/saveload/bool.c
index f202c7f7fda..5453ccfe238 100644
--- a/tests/saveload/bool.c
+++ b/tests/saveload/bool.c
@@ -1,7 +1,7 @@
 /* run.config
    EXECNOW: BIN bool.sav LOG bool_sav.res LOG bool_sav.err ./bin/toplevel.opt -save ./tests/saveload/result/bool.sav -eva -eva-show-progress ./tests/saveload/bool.c > tests/saveload/result/bool_sav.res 2> tests/saveload/result/bool_sav.err
-   OPT: -load ./tests/saveload/result/bool.sav -out -input -deps
-   OPT: -load ./tests/saveload/result/bool.sav -eva
+   STDOPT: +"-load ./tests/saveload/result/bool.sav -out -input -deps"
+   STDOPT: +"-load ./tests/saveload/result/bool.sav -eva"
  */
 
 #include "stdbool.h"
diff --git a/tests/saveload/callbacks.i b/tests/saveload/callbacks.i
index eaac5742247..b1fe21aabd1 100644
--- a/tests/saveload/callbacks.i
+++ b/tests/saveload/callbacks.i
@@ -1,6 +1,6 @@
 /* run.config
    EXECNOW: LOG callbacks_initial.res LOG callbacks_initial.err BIN callbacks.sav ./bin/toplevel.opt tests/saveload/callbacks.i -out -calldeps -eva-show-progress -main main1 -save ./tests/saveload/result/callbacks.sav > ./tests/saveload/result/callbacks_initial.res 2> ./tests/saveload/result/callbacks_initial.err
-   OPT: -load ./tests/saveload/result/callbacks.sav -main main2 -then -main main3
+   STDOPT: +"-load ./tests/saveload/result/callbacks.sav -main main2 -then -main main3"
 */
 
 /* This tests whether the callbacks for callwise inout and from survive after
diff --git a/tests/saveload/deps.i b/tests/saveload/deps.i
index 9999d8a8912..1e7dddc3a3c 100644
--- a/tests/saveload/deps.i
+++ b/tests/saveload/deps.i
@@ -1,11 +1,11 @@
 /* run.config
    EXECNOW: make -s ./tests/saveload/deps_A.cmxs ./tests/saveload/deps_B.cmxs ./tests/saveload/deps_C.cmxs ./tests/saveload/deps_D.cmxs ./tests/saveload/deps_E.cmxs
    EXECNOW: LOG deps_sav.res LOG deps_sav.err BIN deps.sav @frama-c@ -load-module ./tests/saveload/deps_A.cmxs -eva -out -input -deps -eva-show-progress ./tests/saveload/deps.i -save ./tests/saveload/result/deps.sav > ./tests/saveload/result/deps_sav.res 2> ./tests/saveload/result/deps_sav.err
-   OPT: -load-module ./tests/saveload/deps_A -load ./tests/saveload/result/deps.sav -eva -out -input -deps -eva-show-progress 
-   OPT: -load-module ./tests/saveload/deps_B -load ./tests/saveload/result/deps.sav  -out -input -deps -eva-show-progress 
-   OPT: -load-module ./tests/saveload/deps_C -load ./tests/saveload/result/deps.sav  -out -input -deps -eva-show-progress 
-   OPT: -load-module ./tests/saveload/deps_D -load ./tests/saveload/result/deps.sav  -out -input -deps -eva-show-progress 
-   OPT: -load-module ./tests/saveload/deps_E -load ./tests/saveload/result/deps.sav  -out -input -deps -eva-show-progress 
+   STDOPT: +"-load-module ./tests/saveload/deps_A -load ./tests/saveload/result/deps.sav -eva -out -input -deps "
+   STDOPT: +"-load-module ./tests/saveload/deps_B -load ./tests/saveload/result/deps.sav  -out -input -deps "
+   STDOPT: +"-load-module ./tests/saveload/deps_C -load ./tests/saveload/result/deps.sav  -out -input -deps "
+   STDOPT: +"-load-module ./tests/saveload/deps_D -load ./tests/saveload/result/deps.sav  -out -input -deps "
+   STDOPT: +"-load-module ./tests/saveload/deps_E -load ./tests/saveload/result/deps.sav  -out -input -deps "
 */
 
 int main() {
diff --git a/tests/saveload/isset.c b/tests/saveload/isset.c
index cd916529828..e490c3405e8 100644
--- a/tests/saveload/isset.c
+++ b/tests/saveload/isset.c
@@ -1,9 +1,9 @@
 /* run.config
    EXECNOW: LOG isset_sav.res LOG isset_sav.err BIN isset.sav ./bin/toplevel.opt -quiet -eva -save tests/saveload/result/isset.sav tests/saveload/isset.c > ./tests/saveload/result/isset_sav.res 2> ./tests/saveload/result/isset_sav.err
-   OPT: -quiet -load ./tests/saveload/result/isset.sav
-   OPT: -load ./tests/saveload/result/isset.sav
-   OPT: -eva -load ./tests/saveload/result/isset.sav
-   OPT: -quiet -eva -load ./tests/saveload/result/isset.sav
+   STDOPT: +"-quiet -load ./tests/saveload/result/isset.sav"
+   STDOPT: +"-load ./tests/saveload/result/isset.sav"
+   STDOPT: +"-eva -load ./tests/saveload/result/isset.sav"
+   STDOPT: +"-quiet -eva -load ./tests/saveload/result/isset.sav"
 */
 
 int main() {
diff --git a/tests/saveload/load_one.i b/tests/saveload/load_one.i
index 8f58edd1679..75dde3f7292 100644
--- a/tests/saveload/load_one.i
+++ b/tests/saveload/load_one.i
@@ -1,6 +1,6 @@
 /* run.config
    EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs
-   OPT: -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs -eva-show-progress
+   STDOPT: +"-load-module @PTEST_DIR@/@PTEST_NAME@.cmxs"
 */
 int G;
 
diff --git a/tests/saveload/multi_project.i b/tests/saveload/multi_project.i
index e8c3589515c..3a98905ee05 100644
--- a/tests/saveload/multi_project.i
+++ b/tests/saveload/multi_project.i
@@ -1,7 +1,7 @@
 /* run.config
    EXECNOW: BIN multi_project.sav LOG multi_project_sav.res LOG multi_project_sav.err ./bin/toplevel.opt -save ./tests/saveload/result/multi_project.sav -eva-show-progress -semantic-const-folding @PTEST_DIR@/@PTEST_NAME@.i > tests/saveload/result/multi_project_sav.res 2> tests/saveload/result/multi_project_sav.err
    EXECNOW: make -s @PTEST_DIR@/@PTEST_NAME@.cmxs
-   OPT: -load ./tests/saveload/result/multi_project.sav -journal-disable
+   STDOPT: +"-load ./tests/saveload/result/multi_project.sav -journal-disable"
    CMD: @frama-c@ -load-module @PTEST_DIR@/@PTEST_NAME@.cmxs
    OPT: -eva -eva-show-progress
 */
diff --git a/tests/saveload/segfault_datatypes.i b/tests/saveload/segfault_datatypes.i
index 6aba95f697d..0e64333dd66 100644
--- a/tests/saveload/segfault_datatypes.i
+++ b/tests/saveload/segfault_datatypes.i
@@ -1,8 +1,8 @@
 /* run.config
    EXECNOW: make -s ./tests/saveload/segfault_datatypes_A.cmxs ./tests/saveload/segfault_datatypes_B.cmxs
-   EXECNOW: LOG segfault_datatypes_sav.res LOG segfault_datatypes_sav.err BIN segfault_datatypes.sav @frama-c@ -load-module ./tests/saveload/segfault_datatypes_A -eva -out -input -deps -eva-show-progress ./tests/saveload/segfault_datatypes.i -save ./tests/saveload/result/segfault_datatypes.sav > ./tests/saveload/result/segfault_datatypes_sav.res 2> ./tests/saveload/result/segfault_datatypes_sav.err
+   EXECNOW: LOG segfault_datatypes_sav.res LOG segfault_datatypes_sav.err BIN segfault_datatypes.sav @frama-c@ -load-module ./tests/saveload/segfault_datatypes_A -eva -out -input -deps ./tests/saveload/segfault_datatypes.i -eva-show-progress -save ./tests/saveload/result/segfault_datatypes.sav > ./tests/saveload/result/segfault_datatypes_sav.res 2> ./tests/saveload/result/segfault_datatypes_sav.err
    CMD: @frama-c@ -load-module ./tests/saveload/segfault_datatypes_B
-   OPT: -load ./tests/saveload/result/segfault_datatypes.sav -eva -out -input -deps -journal-disable
+   STDOPT: +"-load ./tests/saveload/result/segfault_datatypes.sav -eva -out -input -deps -journal-disable"
 */
 
 
diff --git a/tests/saveload/sparecode.i b/tests/saveload/sparecode.i
index ba347428ae7..33d1776ddc1 100644
--- a/tests/saveload/sparecode.i
+++ b/tests/saveload/sparecode.i
@@ -1,6 +1,6 @@
 /* run.config
    EXECNOW: BIN sparecode.sav LOG sparecode_sav.res LOG sparecode_sav.err ./bin/toplevel.opt -slicing-level 2 -slice-return main -eva-show-progress -save ./tests/saveload/result/sparecode.sav tests/saveload/sparecode.i -then-on 'Slicing export' -print > tests/saveload/result/sparecode_sav.res 2> tests/saveload/result/sparecode_sav.err
-   OPT: -load ./tests/saveload/result/sparecode.sav
+   STDOPT: +"-load ./tests/saveload/result/sparecode.sav"
 */
 int G;
 
diff --git a/tests/saveload/test_config b/tests/saveload/test_config
new file mode 100644
index 00000000000..16c72227f60
--- /dev/null
+++ b/tests/saveload/test_config
@@ -0,0 +1 @@
+OPT: -eva-show-progress
-- 
GitLab