From c81d97102f88796d226422d505d4b0304a60a3d5 Mon Sep 17 00:00:00 2001
From: Virgile Prevosto <virgile.prevosto@m4x.org>
Date: Tue, 11 Jul 2023 11:31:29 +0200
Subject: [PATCH] [tests] Ensure a stable number of source files in
 tests/fc_script/result

---
 tests/fc_script/test_machdep.i       | 3 +++
 tests/fc_script/test_machdep_dummy.i | 8 ++++++++
 2 files changed, 11 insertions(+)
 create 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 9c1a9f629ad..da5a54e0189 100644
--- a/tests/fc_script/test_machdep.i
+++ b/tests/fc_script/test_machdep.i
@@ -1,6 +1,9 @@
 /* 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...
    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
new file mode 100644
index 00000000000..fcbfa736607
--- /dev/null
+++ b/tests/fc_script/test_machdep_dummy.i
@@ -0,0 +1,8 @@
+/* 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}))
+*/
-- 
GitLab