From 0409d79830b42120c91962571218a258de2da329 Mon Sep 17 00:00:00 2001
From: Andre Maroneze <andre.maroneze@cea.fr>
Date: Tue, 8 Mar 2022 10:45:23 +0100
Subject: [PATCH] [E-ACSL] remove SEDCMD and .in test configs

---
 src/plugins/e-acsl/Makefile.in                 | 18 ++----------------
 src/plugins/e-acsl/headers/header_spec.txt     |  4 ++--
 .../e-acsl/tests/concurrency/threads_debug.c   |  2 +-
 .../e-acsl/tests/constructs/printed_data.c     |  2 +-
 .../e-acsl/tests/format/test_config_dev        |  2 +-
 .../e-acsl/tests/special/e-acsl-rt-debug.c     |  2 +-
 .../tests/{test_config.in => test_config}      |  0
 .../{test_config_dev.in => test_config_dev}    |  1 -
 8 files changed, 8 insertions(+), 23 deletions(-)
 rename src/plugins/e-acsl/tests/{test_config.in => test_config} (100%)
 rename src/plugins/e-acsl/tests/{test_config_dev.in => test_config_dev} (98%)

diff --git a/src/plugins/e-acsl/Makefile.in b/src/plugins/e-acsl/Makefile.in
index f94df7c5d9f..40ea1ab2448 100644
--- a/src/plugins/e-acsl/Makefile.in
+++ b/src/plugins/e-acsl/Makefile.in
@@ -233,26 +233,12 @@ E_ACSL_TESTS E_ACSL_DEFAULT_TESTS: $(TEST_DEPENDENCIES)
 tests:: $(TEST_DEPENDENCIES)
 endif
 
-$(EACSL_PLUGIN_DIR)/tests/test_config: \
-		$(EACSL_PLUGIN_DIR)/tests/test_config.in \
-		$(EACSL_PLUGIN_DIR)/Makefile
-	$(PRINT_MAKING) $@
-	$(SED) -e "s|@SEDCMD@|`command -v sed`|g" $< > $@
-
-$(EACSL_PLUGIN_DIR)/tests/test_config_dev: \
-		$(EACSL_PLUGIN_DIR)/tests/test_config_dev.in \
-		$(EACSL_PLUGIN_DIR)/Makefile
-	$(PRINT_MAKING) $@
-	$(SED) -e "s|@SEDCMD@|`command -v sed`|g" $< > $@
-
 clean::
 	for d in $(E_ACSL_EXTRA_DIRS); do \
 	  $(RM) $$d/*~; \
 	done
 	$(PRINT_RM) cleaning generated test files
 	$(RM) $(E_ACSL_DIR)/tests/*.cm* $(E_ACSL_DIR)/tests/*.o
-	$(RM) $(E_ACSL_DIR)/tests/test_config \
-		$(E_ACSL_DIR)/tests/test_config_dev
 	$(RM) $(foreach dir, $(PLUGIN_TESTS_DIRS), tests/$(dir)/result/*)
 
 endif
@@ -353,8 +339,8 @@ EACSL_DOC_FILES = \
 	$(EACSL_MANPAGES)
 
 EACSL_TEST_FILES = \
-	tests/test_config_dev.in \
-	tests/test_config.in \
+	tests/test_config_dev \
+	tests/test_config \
 	tests/wrapper.sh \
 	tests/gmp-only/test_config \
 	tests/gmp-only/test_config_dev \
diff --git a/src/plugins/e-acsl/headers/header_spec.txt b/src/plugins/e-acsl/headers/header_spec.txt
index 602a0802d6d..b7744174c95 100644
--- a/src/plugins/e-acsl/headers/header_spec.txt
+++ b/src/plugins/e-acsl/headers/header_spec.txt
@@ -186,8 +186,8 @@ src/project_initializer/prepare_ast.ml: CEA_LGPL_OR_PROPRIETARY.E_ACSL
 src/project_initializer/prepare_ast.mli: CEA_LGPL_OR_PROPRIETARY.E_ACSL
 tests/E_ACSL_test.ml: CEA_LGPL_OR_PROPRIETARY.E_ACSL
 tests/wrapper.sh: CEA_LGPL_OR_PROPRIETARY.E_ACSL
-tests/test_config.in: .ignore
-tests/test_config_dev.in: .ignore
+tests/test_config: .ignore
+tests/test_config_dev: .ignore
 tests/builtin/test_config: .ignore
 tests/builtin/test_config_dev: .ignore
 tests/concurrency/test_config: .ignore
diff --git a/src/plugins/e-acsl/tests/concurrency/threads_debug.c b/src/plugins/e-acsl/tests/concurrency/threads_debug.c
index 8630415fad3..35837359d4f 100644
--- a/src/plugins/e-acsl/tests/concurrency/threads_debug.c
+++ b/src/plugins/e-acsl/tests/concurrency/threads_debug.c
@@ -4,7 +4,7 @@
   MACRO: ROOT_EACSL_GCC_OPTS_EXT --rt-debug --rt-verbose --concurrency
 
   COMMENT: Filter the addresses of the output so that the test is deterministic.
-  MACRO: ROOT_EACSL_EXEC_FILTER @SEDCMD@ -e s_0x[0-9a-f-]*_0x0000-0000-0000_g | @SEDCMD@ -e s_Offset:\s[0-9-]*_Offset:xxxxx_g | @SEDCMD@ -e s/[0-9]*\skB/xxxkB/g | @SEDCMD@ -e s/Leaked.*bytes/Leakedxxxbytes/g
+  MACRO: ROOT_EACSL_EXEC_FILTER sed -e s_0x[0-9a-f-]*_0x0000-0000-0000_g | sed -e s_Offset:\s[0-9-]*_Offset:xxxxx_g | sed -e s/[0-9]*\skB/xxxkB/g | sed -e s/Leaked.*bytes/Leakedxxxbytes/g
 */
 
 // Include existing test
diff --git a/src/plugins/e-acsl/tests/constructs/printed_data.c b/src/plugins/e-acsl/tests/constructs/printed_data.c
index 9ae22944705..36b5d8e0c43 100644
--- a/src/plugins/e-acsl/tests/constructs/printed_data.c
+++ b/src/plugins/e-acsl/tests/constructs/printed_data.c
@@ -4,7 +4,7 @@
 /* run.config_dev
    COMMENT: Print the data and filter the addresses of the output so that the test is deterministic.
    MACRO: ROOT_EACSL_GCC_OPTS_EXT --assert-print-data -e -DE_ACSL_DEBUG_ASSERT -F -no-unicode
-   MACRO: ROOT_EACSL_EXEC_FILTER @SEDCMD@ -e s/0x[0-9a-f]*$/0x000000/g
+   MACRO: ROOT_EACSL_EXEC_FILTER sed -e s/0x[0-9a-f]*$/0x000000/g
  */
 
 #include <float.h>
diff --git a/src/plugins/e-acsl/tests/format/test_config_dev b/src/plugins/e-acsl/tests/format/test_config_dev
index e561c38846b..5a5d4036dc8 100644
--- a/src/plugins/e-acsl/tests/format/test_config_dev
+++ b/src/plugins/e-acsl/tests/format/test_config_dev
@@ -1,3 +1,3 @@
 COMMENT: Remove --full-mtracking once e-acsl#118 is fixed
 MACRO: ROOT_EACSL_GCC_OPTS_EXT --validate-format-strings --full-mtracking -F -variadic-no-translation
-MACRO: ROOT_EACSL_EXEC_FILTER @SEDCMD@ -e s+/.*/share/e-acsl+FRAMAC_SHARE/e-acsl+
+MACRO: ROOT_EACSL_EXEC_FILTER sed -e s+/.*/share/e-acsl+FRAMAC_SHARE/e-acsl+
diff --git a/src/plugins/e-acsl/tests/special/e-acsl-rt-debug.c b/src/plugins/e-acsl/tests/special/e-acsl-rt-debug.c
index c23b4ddf50f..ec28d64c54f 100644
--- a/src/plugins/e-acsl/tests/special/e-acsl-rt-debug.c
+++ b/src/plugins/e-acsl/tests/special/e-acsl-rt-debug.c
@@ -5,7 +5,7 @@
 /* run.config_dev
   MACRO: ROOT_EACSL_GCC_OPTS_EXT --rt-debug --rt-verbose --full-mtracking
   COMMENT: Filter the addresses of the output so that the test is deterministic.
-  MACRO: ROOT_EACSL_EXEC_FILTER @SEDCMD@ -e s_0x[0-9a-f-]*_0x0000-0000-0000_g | @SEDCMD@ -e s_Offset:\s[0-9-]*_Offset:xxxxx_g | @SEDCMD@ -e s/[0-9]*\skB/xxxkB/g
+  MACRO: ROOT_EACSL_EXEC_FILTER sed -e s_0x[0-9a-f-]*_0x0000-0000-0000_g | sed -e s_Offset:\s[0-9-]*_Offset:xxxxx_g | sed -e s/[0-9]*\skB/xxxkB/g
  */
 int main() {
   return 0;
diff --git a/src/plugins/e-acsl/tests/test_config.in b/src/plugins/e-acsl/tests/test_config
similarity index 100%
rename from src/plugins/e-acsl/tests/test_config.in
rename to src/plugins/e-acsl/tests/test_config
diff --git a/src/plugins/e-acsl/tests/test_config_dev.in b/src/plugins/e-acsl/tests/test_config_dev
similarity index 98%
rename from src/plugins/e-acsl/tests/test_config_dev.in
rename to src/plugins/e-acsl/tests/test_config_dev
index ca8f3b14da0..0ce872fd889 100644
--- a/src/plugins/e-acsl/tests/test_config_dev.in
+++ b/src/plugins/e-acsl/tests/test_config_dev
@@ -1,5 +1,4 @@
 NOFRAMAC: only the EXEC command below is useful in this config
-MACRO: SEDCMD @SEDCMD@
 MACRO: EACSL_ERR @PTEST_NAME@.e-acsl.err.log
 
 COMMENT: Default options for `e-acsl-gcc.sh`
-- 
GitLab