diff --git a/test/blackbox-tests/test-cases/rocq-native/compose-installed-compat.t/run.t b/test/blackbox-tests/test-cases/rocq-native/compose-installed-compat.t/run.t index f9f97592b1e..3673f47e11b 100644 --- a/test/blackbox-tests/test-cases/rocq-native/compose-installed-compat.t/run.t +++ b/test/blackbox-tests/test-cases/rocq-native/compose-installed-compat.t/run.t @@ -42,7 +42,7 @@ so this also tests that it won't be a problem. Next we go into our Dune project and build it. - $ dune build --root A + $ dune build --trace-file trace.json --root A Entering directory 'A' Inductive hello : Set := I : hello | am : hello | an : hello | install : hello | loc : hello. @@ -50,20 +50,52 @@ Next we go into our Dune project and build it. Now we check the flags that were passed to coqdep and coqc: - $ tail -4 A/_build/log | head -2 | ../scrub_coq_args.sh - rocq dep - -boot - -R coq/theories Corelib - -Q $TESTCASE_ROOT/lib/coq/user-contrib/B B - -R . A -dyndep opt -vos a.v > - _build/default/.A.theory.d - rocq compile -q - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -Q $TESTCASE_ROOT/lib/coq/user-contrib/B B - -R . A - a.v + $ jq '.[] | select(.cat == "process" and (.args.process_args.[0] | IN ("compile", "dep"))) | {name, args: (.args.process_args | map(sub(".*/coq-core"; "coq-core")))}' trace.json + { + "name": "rocq", + "args": [ + "dep", + "-boot", + "-R", + "$TESTCASE_ROOT/lib/coq/theories", + "Corelib", + "-Q", + "$TESTCASE_ROOT/lib/coq/user-contrib/B", + "B", + "-R", + ".", + "A", + "-dyndep", + "opt", + "-vos", + "a.v" + ] + } + { + "name": "rocq", + "args": [ + "compile", + "-q", + "-w", + "-deprecated-native-compiler-option", + "-native-output-dir", + ".", + "-native-compiler", + "on", + "-nI", + "/home/runner/work/dune/dune/_opam/lib/rocq-runtime/kernel", + "-nI", + ".", + "-boot", + "-R", + "$TESTCASE_ROOT/lib/coq/theories", + "Corelib", + "-Q", + "$TESTCASE_ROOT/lib/coq/user-contrib/B", + "B", + "-R", + ".", + "A", + "a.v" + ] + } diff --git a/test/blackbox-tests/test-cases/rocq-native/coqtop/coqtop-flags.t/run.t b/test/blackbox-tests/test-cases/rocq-native/coqtop/coqtop-flags.t/run.t index 9a0a42aa7aa..42ce25d9b6a 100644 --- a/test/blackbox-tests/test-cases/rocq-native/coqtop/coqtop-flags.t/run.t +++ b/test/blackbox-tests/test-cases/rocq-native/coqtop/coqtop-flags.t/run.t @@ -1,17 +1,29 @@ Testing that the correct flags are being passed to dune rocq top The flags passed to coqc: - $ dune build && tail -1 _build/log | ../../scrub_coq_args.sh - rocq compile - -w -notation-overridden - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . minimal - Test.v + $ dune build --trace-file trace.json + $ jq '.[] | select(.cat == "process" and (.args.process_args.[0] == "compile")) | .args.process_args | .[] | sub(".*/coq/theories"; "coq/theories") | sub(".*/rocq-runtime/"; "rocq-runtime/")' trace.json + "compile" + "-w" + "-notation-overridden" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "minimal" + "Test.v" The flags passed to coqtop: $ dune rocq top --toplevel=echo Test.v | ../../scrub_coq_args.sh diff --git a/test/blackbox-tests/test-cases/rocq-native/flags.t b/test/blackbox-tests/test-cases/rocq-native/flags.t index d8c02c0bcd7..79c4b043de5 100644 --- a/test/blackbox-tests/test-cases/rocq-native/flags.t +++ b/test/blackbox-tests/test-cases/rocq-native/flags.t @@ -9,6 +9,12 @@ Test cases to check Coq's flag setting is correct: > Definition t := 3. > EOF + $ runFlags() { + > dune clean + > dune build --trace-file trace.json foo.vo + > jq -c '.[] | select(.name == "rocq") | .args.process_args | .[] | sub(".*/coq/"; "coq/") | sub(".*/rocq-runtime/"; "rocq-runtime/")' trace.json + > } + Test case: default flags $ cat > dune < (name foo)) > EOF - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -q - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-q" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: :standard @@ -35,17 +65,40 @@ TC: :standard > (flags :standard)) > EOF - $ rm _build/default/foo.vo - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -q - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-q" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: override :standard @@ -55,16 +108,39 @@ TC: override :standard > (flags )) > EOF - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: add to :standard @@ -74,16 +150,41 @@ TC: add to :standard > (flags :standard -type-in-type)) > EOF - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -q -type-in-type - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-q" + "-type-in-type" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: extend in workspace + override standard @@ -98,16 +199,40 @@ TC: extend in workspace + override standard > (env (dev (rocq (flags -type-in-type)))) > EOF - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -type-in-type - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-type-in-type" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: extend in workspace + override standard @@ -116,16 +241,41 @@ TC: extend in workspace + override standard > (env (dev (rocq (flags :standard -type-in-type)))) > EOF - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -q -type-in-type - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-q" + "-type-in-type" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: extend in dune (env) + override standard @@ -135,17 +285,40 @@ TC: extend in dune (env) + override standard > (env (dev (rocq (flags -type-in-type)))) > EOF - $ rm -rf _build/default/foo.vo - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -type-in-type - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-type-in-type" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: extend in dune (env) + standard @@ -155,17 +328,42 @@ TC: extend in dune (env) + standard > (env (dev (rocq (flags :standard -type-in-type)))) > EOF - $ rm -rf _build/default/foo.vo - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -q -type-in-type -type-in-type - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-q" + "-type-in-type" + "-type-in-type" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v" TC: extend in dune (env) + workspace + standard @@ -180,14 +378,39 @@ TC: extend in dune (env) + workspace + standard > (env (dev (rocq (flags :standard -type-in-type)))) > EOF - $ rm -rf _build/default/foo.vo - $ dune build foo.vo && tail -n 1 _build/log | ./scrub_coq_args.sh - rocq compile -q -type-in-type -bt - -w -deprecated-native-compiler-option -native-output-dir . - -native-compiler on - -nI lib/rocq-runtime/kernel - -nI . - -boot - -R coq/theories Corelib - -R . foo - foo.v + $ runFlags + "--config" + "dep" + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "-dyndep" + "opt" + "-vos" + "foo.v" + "compile" + "-q" + "-type-in-type" + "-bt" + "-w" + "-deprecated-native-compiler-option" + "-native-output-dir" + "." + "-native-compiler" + "on" + "-nI" + "rocq-runtime/kernel" + "-nI" + "." + "-boot" + "-R" + "coq/theories" + "Corelib" + "-R" + "." + "foo" + "foo.v"