From e17624a99e99e60708cd90b789b25b0fea52742e Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Wed, 12 Jul 2023 15:14:19 +0200
Subject: [PATCH] [tests] Much simpler approach to ensure test_machdep.i is
 always in test dir

---
 tests/fc_script/test_machdep.i       | 8 +++++---
 tests/fc_script/test_machdep_dummy.i | 9 ---------
 2 files changed, 5 insertions(+), 12 deletions(-)
 delete mode 100644 tests/fc_script/test_machdep_dummy.i

diff --git a/tests/fc_script/test_machdep.i b/tests/fc_script/test_machdep.i
index da5a54e0189..923485dde8e 100644
--- a/tests/fc_script/test_machdep.i
+++ b/tests/fc_script/test_machdep.i
@@ -1,9 +1,11 @@
 /* run.config
    NOFRAMAC: Just test the generation of a custom machdep with the installed script.
    COMMENT: No C code gets analyzed there. File is empty on purpose
-   COMMENT: WARNING: be sure to keep the ENABLED_IF below in sync with test_machdep_dummy.i
-   COMMENT: a disabled file is not copied, and some _other_ tests contain in their oracles
-   COMMENT: the number of .{ci} files in the directory...
+   COMMENT: be sure to keep the first EXECNOW: it ensures
+   COMMENT: that dune will copy the file regardless of the environment
+   COMMENT: so that other tests whose oracles depend on the number of file in
+   COMMENT: the directory will be stable.
+   EXECNOW: LOG empty.res touch empty.res
    ENABLED_IF: (and %{bin-available:clang} %{bin-available:yq})
    FILTER: sed -e '/^version:/d'
    EXECNOW: LOG custom_machdep.yaml LOG make_machdep.err.log PTESTS_TESTING=1 %{bin:frama-c-script} make-machdep --compiler clang --cpp-arch-flags='--target=x86_64' | yq -Y 'del(.version)|del(.custom_defs)' > custom_machdep.yaml 2> make_machdep.err.log
diff --git a/tests/fc_script/test_machdep_dummy.i b/tests/fc_script/test_machdep_dummy.i
deleted file mode 100644
index b2e24660bf2..00000000000
--- a/tests/fc_script/test_machdep_dummy.i
+++ /dev/null
@@ -1,9 +0,0 @@
-/* run.config
-   NOFRAMAC: Just test the generation of a custom machdep with the installed script.
-   COMMENT: This is just a placeholder file for test_machdep.i when clang or yq is unavailable.
-   COMMENT: In that case, we don't do the test, but still need to copy a .i file
-   COMMENT: to keep the number of files inspected by fc-script identical.
-   COMMENT: WARNING: be sure to keep the ENABLED_IF below in sync with test_machdep.i
-   ENABLED_IF: (or (not %{bin-available:clang}) (not %{bin-available:yq}))
-   EXECNOW: LOG test.res touch test.res
-*/
-- 
GitLab