This commit is contained in:
swrup 2025-11-11 02:07:51 +01:00
parent aa2ff7b2f0
commit 2f3113f55d
11742 changed files with 1223940 additions and 0 deletions

View file

@ -0,0 +1,3 @@
(coq.theory
(name minimal)
(flags -w -notation-overridden))

View file

@ -0,0 +1,2 @@
(lang dune 3.7)
(using coq 0.7)

View file

@ -0,0 +1,74 @@
Testing that the correct flags are being passed to dune coq top
The flags passed to coqc:
$ dune build && tail -1 _build/log | ../../scrub_coq_args.sh
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
coqc
-w -notation-overridden
-w -deprecated-native-compiler-option -native-output-dir .
-native-compiler on
-nI lib/coq-core/kernel
-nI .
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R . minimal
Test.v
The flags passed to coqtop:
$ dune coq top --toplevel=echo Test.v | ../../scrub_coq_args.sh
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
-topfile $TESTCASE_ROOT/_build/default/Test.v
-w -notation-overridden
-w -deprecated-native-compiler-option -native-output-dir .
-native-compiler on
-nI lib/coq-core/kernel
-nI $TESTCASE_ROOT/_build/default
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default minimal

View file

@ -0,0 +1,22 @@
Running the Coq Toplevel on a generated file with a dependency.
$ cat >bar.v <<EOF
> From basic Require Import foo.
> Definition mynum (i : mynat) := 3.
> EOF
$ cat >foo.v <<EOF
> Definition mynat := nat.
> EOF
$ cat >dune-project <<EOF
> (lang dune 3.8)
> (using coq 0.8)
> EOF
$ cat >dune <<EOF
> (coq.theory
> (name basic))
> (rule
> (target bar_gen.v)
> (deps bar.v)
> (action (copy %{deps} %{target})))
> EOF
$ cat bar.v | dune coq top bar_gen.v > /dev/null 2> /dev/null

View file

@ -0,0 +1,3 @@
(lang dune 3.0)
(using coq 0.3)

View file

@ -0,0 +1,78 @@
Checking that we compute the directory and file for dune coq top correctly
$ dune build theories/c.vo
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
$ dune build theories/b/b.vo
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
$ dune coq top --toplevel=echo theories/c.v | ../../scrub_coq_args.sh
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
-topfile $TESTCASE_ROOT/_build/default/theories/c.v
-w -deprecated-native-compiler-option
-w -native-compiler-disabled
-native-compiler ondemand
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/theories foo
$ dune coq top --toplevel=echo theories/b/b.v | ../../scrub_coq_args.sh
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
-topfile $TESTCASE_ROOT/_build/default/theories/b/b.v
-w -deprecated-native-compiler-option
-w -native-compiler-disabled
-native-compiler ondemand
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/theories foo

View file

@ -0,0 +1,3 @@
Require a.
Definition moo := a.bar.

View file

@ -0,0 +1,3 @@
Require d.
Definition uuhh := d.aike.

View file

@ -0,0 +1,4 @@
(coq.theory
(name foo))
(include_subdirs qualified)

View file

@ -0,0 +1,86 @@
Testing the -no-build option of dune coq top:
$ mkdir dir
$ cat >dir/bar.v <<EOF
> From basic Require Import foo.
> Definition mynum (i : mynat) := 3.
> EOF
$ cat >dir/foo.v <<EOF
> Definition mynat := nat.
> EOF
$ cat >dir/dune <<EOF
> (coq.theory
> (name basic))
> EOF
$ cat >dune-project <<EOF
> (lang dune 3.8)
> (using coq 0.8)
> EOF
On a fresh build, this should do nothing but should pass the correct flags:
$ dune coq top --no-build --display short --toplevel echo dir/bar.v | ../scrub_coq_args.sh
-topfile $TESTCASE_ROOT/_build/default/dir/bar.v
-w -deprecated-native-compiler-option -native-output-dir .
-native-compiler on
-nI lib/coq-core/kernel
-nI $TESTCASE_ROOT/_build/default/dir
-boot
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/dir basic
And for comparison normally a build would happen:
$ dune coq top --display short --toplevel echo dir/bar.v | ../scrub_coq_args.sh
coqdep dir/.basic.theory.d
coqc dir/Nbasic_foo.{cmi,cmxs},dir/foo.{glob,vo}
-topfile $TESTCASE_ROOT/_build/default/dir/bar.v
-w -deprecated-native-compiler-option -native-output-dir .
-native-compiler on
-nI lib/coq-core/kernel
-nI $TESTCASE_ROOT/_build/default/dir
-boot
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/dir basic

View file

@ -0,0 +1,14 @@
Running the Coq Toplevel on a file that is not part of a stanza.
$ cat >foo.v <<EOF
> Definition mynat := nat.
> EOF
$ cat >dune-project <<EOF
> (lang dune 3.0)
> (using coq 0.3)
> EOF
$ dune coq top foo.v || echo failed
Error: Cannot find file: foo.v
Hint: Is the file part of a stanza?
Hint: Has the file been written to disk?
failed

View file

@ -0,0 +1,158 @@
Check that dependencies are not recompiled when this is not necessary. This
was initially an issue, and was reported by @MackieLoeffel in #5457 (see
https://github.com/ocaml/dune/pull/5457#issuecomment-1084161587).
$ mkdir dir
$ cat >dir/bar.v <<EOF
> From basic Require Import foo.
> Definition mynum (i : mynat) := 3.
> EOF
$ cat >dir/foo.v <<EOF
> Definition mynat := nat.
> EOF
$ cat >dir/dune <<EOF
> (coq.theory
> (name basic))
> EOF
$ cat >dune-project <<EOF
> (lang dune 3.0)
> (using coq 0.3)
> EOF
$ dune coq top --display short --toplevel echo dir/bar.v | ../scrub_coq_args.sh
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
coqdep dir/.basic.theory.d
coqc dir/foo.{glob,vo}
-topfile $TESTCASE_ROOT/_build/default/dir/bar.v
-w -deprecated-native-compiler-option
-w -native-compiler-disabled
-native-compiler ondemand
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/dir basic
$ dune coq top --display short --toplevel echo dir/bar.v | ../scrub_coq_args.sh
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
-topfile $TESTCASE_ROOT/_build/default/dir/bar.v
-w -deprecated-native-compiler-option
-w -native-compiler-disabled
-native-compiler ondemand
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/dir basic
$ dune clean
$ (cd dir && dune coq top --root .. --display short --toplevel echo dir/bar.v) | ../scrub_coq_args.sh
Entering directory '..'
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
coqdep dir/.basic.theory.d
coqc dir/foo.{glob,vo}
Leaving directory '..'
-topfile $TESTCASE_ROOT/_build/default/dir/bar.v
-w -deprecated-native-compiler-option
-w -native-compiler-disabled
-native-compiler ondemand
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/dir basic
$ (cd dir && dune coq top --root .. --display short --toplevel echo dir/bar.v) | ../scrub_coq_args.sh
Entering directory '..'
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
Leaving directory '..'
-topfile $TESTCASE_ROOT/_build/default/dir/bar.v
-w -deprecated-native-compiler-option
-w -native-compiler-disabled
-native-compiler ondemand
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/dir basic

View file

@ -0,0 +1,3 @@
(lang dune 3.0)
(using coq 0.3)

View file

@ -0,0 +1,49 @@
All dune commands work when you run them in sub-directories, so this should be no exception.
$ dune coq top --toplevel=echo -- theories/foo.v | ../../scrub_coq_args.sh
Warning: Coq Language Versions lower than 0.8 have been deprecated in Dune
3.8 and will be removed in an upcoming Dune version.
Hint: To disable this warning, add the following to your dune-project file:
(warnings (deprecated_coq_lang_lt_08 disabled))
-topfile $TESTCASE_ROOT/_build/default/theories/foo.v
-w -deprecated-native-compiler-option
-w -native-compiler-disabled
-native-compiler ondemand
-I lib/coq/../coq-core/plugins/btauto
-I lib/coq/../coq-core/plugins/cc
-I lib/coq/../coq-core/plugins/derive
-I lib/coq/../coq-core/plugins/extraction
-I lib/coq/../coq-core/plugins/firstorder
-I lib/coq/../coq-core/plugins/funind
-I lib/coq/../coq-core/plugins/ltac
-I lib/coq/../coq-core/plugins/ltac2
-I lib/coq/../coq-core/plugins/micromega
-I lib/coq/../coq-core/plugins/nsatz
-I lib/coq/../coq-core/plugins/number_string_notation
-I lib/coq/../coq-core/plugins/ring
-I lib/coq/../coq-core/plugins/rtauto
-I lib/coq/../coq-core/plugins/ssreflect
-I lib/coq/../coq-core/plugins/ssrmatching
-I lib/coq/../coq-core/plugins/tauto
-I lib/coq/../coq-core/plugins/tutorial/p0
-I lib/coq/../coq-core/plugins/tutorial/p1
-I lib/coq/../coq-core/plugins/tutorial/p2
-I lib/coq/../coq-core/plugins/tutorial/p3
-I lib/coq/../coq-core/plugins/zify
-R coq/theories Coq
-R $TESTCASE_ROOT/_build/default/theories foo
$ cd theories
This test is currently broken due to the workspace resolution being faulty #5899.
$ dune coq top --toplevel=echo -- foo.v
File ".", line 1, characters 0-0:
Warning: No dune-project file has been found in directory ".". A default one
is assumed but the project might break when dune is upgraded. Please create a
dune-project file.
Hint: generate the project file with: $ dune init project <name>
File "dune", lines 1-2, characters 0-24:
1 | (coq.theory
2 | (name foo))
Error: 'coq.theory' is available only when coq is enabled in the dune-project
file. You must enable it using (using coq 0.10) in your dune-project file.
[1]

View file

@ -0,0 +1,2 @@
(coq.theory
(name foo))

View file

@ -0,0 +1 @@
Definition answer := 42.

View file

@ -0,0 +1,3 @@
(include_subdirs qualified)
(coq.theory
(name theory2))

View file

@ -0,0 +1,2 @@
(coq.theory
(name theory1))

View file

@ -0,0 +1,2 @@
(lang dune 3.8)
(using coq 0.8)

View file

@ -0,0 +1,3 @@
(include_subdirs qualified)
(coq.theory
(name theory4))

View file

@ -0,0 +1,2 @@
(coq.theory
(name theory3))

View file

@ -0,0 +1,2 @@
(lang dune 3.8)
(using coq 0.8)

View file

@ -0,0 +1,108 @@
Running "dune coq top" from different directories in a workspace. The setup is
a workspace whose root is the root of a first project, and a second project is
contained under directory "project".
$ unset INSIDE_DUNE
$ . ./util.sh
Calling "dune coq top" from the workspace root.
$ coqtop_test file1.v
$ coqtop_test coq_dir1/file2.v
$ coqtop_test coq_dir1/dir1/file3.v
$ coqtop_test project/file4.v
$ coqtop_test project/coq_dir2/file5.v
$ coqtop_test project/coq_dir2/dir2/file6.v
Calling "dune coq top" from the "coq_dir1" directory.
$ cd coq_dir1
$ coqtop_test ../file1.v
$ coqtop_test ../file1.v
$ coqtop_test ../coq_dir1/file2.v
$ coqtop_test ../coq_dir1/dir1/file3.v
$ coqtop_test ../project/file4.v
$ coqtop_test ../project/coq_dir2/file5.v
$ coqtop_test ../project/coq_dir2/dir2/file6.v
$ coqtop_test file2.v
$ coqtop_test dir1/file3.v
$ cd ..
Calling "dune coq top" from the "coq_dir1/dir1" directory.
$ cd coq_dir1/dir1
$ coqtop_test ../../file1.v
$ coqtop_test ../../file1.v
$ coqtop_test ../../coq_dir1/file2.v
$ coqtop_test ../../coq_dir1/dir1/file3.v
$ coqtop_test ../../project/file4.v
$ coqtop_test ../../project/coq_dir2/file5.v
$ coqtop_test ../../project/coq_dir2/dir2/file6.v
$ coqtop_test ../file2.v
$ coqtop_test ../dir1/file3.v
$ coqtop_test file3.v
$ cd ../..
Calling "dune coq top" from the "project" directory.
$ cd project
$ coqtop_test ../file1.v
$ coqtop_test ../coq_dir1/file2.v
$ coqtop_test ../coq_dir1/dir1/file3.v
$ coqtop_test ../project/file4.v
$ coqtop_test ../project/coq_dir2/file5.v
$ coqtop_test ../project/coq_dir2/dir2/file6.v
$ coqtop_test file4.v
$ coqtop_test coq_dir2/file5.v
$ coqtop_test coq_dir2/dir2/file6.v
$ cd ..
Calling "dune coq top" from the "project/coq_dir2" directory.
$ cd project/coq_dir2
$ coqtop_test ../../file1.v
$ coqtop_test ../../file1.v
$ coqtop_test ../../coq_dir1/file2.v
$ coqtop_test ../../coq_dir1/dir1/file3.v
$ coqtop_test ../../project/file4.v
$ coqtop_test ../../project/coq_dir2/file5.v
$ coqtop_test ../../project/coq_dir2/dir2/file6.v
$ coqtop_test ../file4.v
$ coqtop_test ../coq_dir2/file5.v
$ coqtop_test ../coq_dir2/dir2/file6.v
$ coqtop_test file5.v
$ coqtop_test dir2/file6.v
$ cd ../..
Calling "dune coq top" from the "project/coq_dir2/dir2" directory.
$ cd project/coq_dir2/dir2
$ coqtop_test ../../../file1.v
$ coqtop_test ../../../file1.v
$ coqtop_test ../../../coq_dir1/file2.v
$ coqtop_test ../../../coq_dir1/dir1/file3.v
$ coqtop_test ../../../project/file4.v
$ coqtop_test ../../../project/coq_dir2/file5.v
$ coqtop_test ../../../project/coq_dir2/dir2/file6.v
$ coqtop_test ../../file4.v
$ coqtop_test ../../coq_dir2/file5.v
$ coqtop_test ../../coq_dir2/dir2/file6.v
$ coqtop_test ../file5.v
$ coqtop_test ../dir2/file6.v
$ coqtop_test file6.v
$ cd ../../..

View file

@ -0,0 +1,5 @@
OUTPUT="$PWD/coqtop_test.tmp"
coqtop_test() {
(true | (dune coq top "$1" 1>$OUTPUT 2>&1)) || cat $OUTPUT
}

View file

@ -0,0 +1,18 @@
Running the Coq Toplevel on a file with a dependency.
$ cat >bar.v <<EOF
> From basic Require Import foo.
> Definition mynum (i : mynat) := 3.
> EOF
$ cat >foo.v <<EOF
> Definition mynat := nat.
> EOF
$ cat >dune-project <<EOF
> (lang dune 3.0)
> (using coq 0.3)
> EOF
$ cat >dune <<EOF
> (coq.theory
> (name basic))
> EOF
$ cat bar.v | dune coq top bar.v > /dev/null 2> /dev/null