From 626e7361f5568e230e701190ce70dc2c16534acb Mon Sep 17 00:00:00 2001
From: Patrick Baudin <patrick.baudin@cea.fr>
Date: Wed, 1 Dec 2021 16:08:55 +0100
Subject: [PATCH] [tests] using hack for tests/misc/global_decl_loc*.i

---
 tests/misc/global_decl_loc.i  | 4 ++--
 tests/misc/global_decl_loc2.i | 7 +++----
 tests/misc/test_config        | 6 ++++++
 3 files changed, 11 insertions(+), 6 deletions(-)

diff --git a/tests/misc/global_decl_loc.i b/tests/misc/global_decl_loc.i
index 8816b71f852..e096a28e5ed 100644
--- a/tests/misc/global_decl_loc.i
+++ b/tests/misc/global_decl_loc.i
@@ -1,6 +1,6 @@
 /* run.config
- COMMENT: the script "global_decl_loc.ml" is also copied by the test "global_decl_loc2.i"
- MODULE: global_decl_loc
+ COMMENT: with dune, the LIBS directive must be replaced by a MODULE directive (see also ./test_config file)
+ LIBS: global_decl_loc
    OPT: @PTEST_DIR@/global_decl_loc2.i
  */
 
diff --git a/tests/misc/global_decl_loc2.i b/tests/misc/global_decl_loc2.i
index 10be90eef73..3c446194a0f 100644
--- a/tests/misc/global_decl_loc2.i
+++ b/tests/misc/global_decl_loc2.i
@@ -1,8 +1,7 @@
 /* run.config*
- COMMENT: todo in the future: removes the EXECNOW command and modifies the MODULE directive in order to reuse "global_decl_loc"
- COMMENT: the script "global_decl_loc.ml" is also used by the test "global_decl_loc.i"
- EXECNOW: BIN global_decl_loc2.ml cp @PTEST_DIR@/global_decl_loc.ml @PTEST_RESULT@/global_decl_loc2.ml > @DEV_NULL@ 2> @DEV_NULL@
- MODULE: result/global_decl_loc2
+ COMMENT: with dune, the LIBS directive must be replaced by a MODULE directive (see also ./test_config file)
+ LIBS: global_decl_loc
+
    OPT: @PTEST_DIR@/global_decl_loc.i
 */
 extern int g;
diff --git a/tests/misc/test_config b/tests/misc/test_config
index 2cfb7e2f920..9ffa03dfdba 100644
--- a/tests/misc/test_config
+++ b/tests/misc/test_config
@@ -1,5 +1,11 @@
 PLUGIN:
+
+# COMMENT: The next directive is a hack because the module is used
+# COMMENT: by more than one test file (./global_decl_loc.i & ./global_decl_loc2.c)
+# COMMENT: and it can be compiled only once due to ptests concurency.
+# COMMENT: That line should be removed with dune and modifications have to be done in ./global_decl_loc.i and ./global_decl_loc2.c.
 MODULE: global_decl_loc
+
 MODULE:
 STDOPT:
 
-- 
GitLab