Skip to content

Commit 210c7cb

Browse files
proux01gares
andcommitted
Move tests requiring Stdlib to separate directories
Co-authored-by: Enrico Tassi <[email protected]>
1 parent de9bba2 commit 210c7cb

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+252
-60
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ _build
5555
tmp.out
5656
coq-elpi-tests.opam
5757
coq-elpi-tests.install
58-
coq-elpi.install
58+
coq-elpi.install
59+
60+
theories-stdlib/dune

Makefile

Lines changed: 34 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -10,44 +10,66 @@ elpi/dune: elpi/dune.in
1010
fi
1111
@chmod a-w $@
1212

13-
all: elpi/dune
13+
all: elpi/dune theories-stdlib/dune
1414
$(call dune,build)
1515
$(call dune,build) builtin-doc
1616
.PHONY: all
1717

18-
build-core: elpi/dune
18+
build-core: elpi/dune theories-stdlib/dune
1919
$(call dune,build) theories
2020
$(call dune,build) builtin-doc
2121
.PHONY: build-core
2222

23-
build-apps: elpi/dune
23+
build-apps: elpi/dune theories-stdlib/dune
2424
$(call dune,build) $$(find apps -type d -name theories)
2525
.PHONY: build-apps
2626

27-
build: elpi/dune
27+
build: elpi/dune theories-stdlib/dune
2828
$(call dune,build) -p coq-elpi @install
2929
$(call dune,build) builtin-doc
3030
.PHONY: build
3131

32-
test-core: elpi/dune
32+
all-tests: test-core test-stdlib test-apps test-apps-stdlib
33+
.PHONY: all-tests
34+
35+
test-core: elpi/dune theories-stdlib/dune
3336
$(call dune,runtest) tests
3437
$(call dune,build) tests
3538
.PHONY: test-core
3639

37-
test-apps: elpi/dune
40+
test-apps: elpi/dune theories-stdlib/dune
3841
$(call dune,build) $$(find apps -type d -name tests)
3942
.PHONY: test-apps
4043

41-
test: elpi/dune
42-
$(call dune,runtest)
43-
$(call dune,build) tests
44-
$(call dune,build) $$(find apps -type d -name tests)
45-
.PHONY: test
44+
test-apps-stdlib: elpi/dune theories-stdlib/dune
45+
$(call dune,build) $$(find apps -type d -name tests-stdlib)
46+
.PHONY: test-apps-stdlib
47+
48+
test-stdlib: elpi/dune theories-stdlib/dune
49+
$(call dune,build) tests-stdlib
50+
.PHONY: test-stdlib
4651

47-
examples: elpi/dune
52+
all-examples: examples examples-stdlib
53+
.PHONY: all-examples
54+
55+
examples: elpi/dune theories-stdlib/dune
4856
$(call dune,build) examples
4957
.PHONY: examples
5058

59+
examples-stdlib: elpi/dune theories-stdlib/dune
60+
$(call dune,build) examples-stdlib
61+
.PHONY: examples-stdlib
62+
63+
theories-stdlib/dune: theories-stdlib/dune.in
64+
@rm -f $@
65+
@echo "; generated by make, do not edit" > $@
66+
@if $$(coqc --version | grep -q "8.19\|8.20") ; then \
67+
sed -e 's/@@STDLIB@@//' $< >> $@ ; \
68+
else \
69+
sed -e 's/@@STDLIB@@/Stdlib/' $< >> $@ ; \
70+
fi
71+
@chmod a-w $@
72+
5173
doc: build
5274
@echo "########################## generating doc ##########################"
5375
@mkdir -p doc

apps/derive/tests-stdlib/dune

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
(coq.theory
2+
(package coq-elpi-tests-stdlib)
3+
(name elpi_apps_derive_tests_stdlib)
4+
(flags :standard -w -default-output-directory)
5+
(theories elpi elpi.apps.derive elpi.apps.derive.tests elpi_stdlib))
6+
7+
(include_subdirs qualified)

apps/derive/tests/test_derive.v renamed to apps/derive/tests-stdlib/test_derive.v

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,3 @@ End derive_container.
170170
About wimpls.wimpls.
171171
About wimpls.Kwi.
172172
Redirect "tmp" Check Kwi _ (refl_equal 3).
173-
174-
From Coq Require Ascii.
175-
176-
#[only(param2)] derive Ascii.ascii.

apps/eltac/tests-stdlib/dune

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
(coq.theory
2+
(package coq-elpi-tests-stdlib)
3+
(name elpi_apps_eltac_tests_stdlib)
4+
(theories elpi elpi.apps.eltac elpi_stdlib))
5+
6+
(include_subdirs qualified)
File renamed without changes.

apps/tc/examples/dune

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
(coq.theory
22
(name elpi.apps.tc.examples)
3-
(theories elpi elpi.apps.tc))
3+
(theories elpi elpi.apps.tc elpi_stdlib))
44

55
(include_subdirs qualified)

apps/tc/examples/tutorial.v

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Require Import Bool.
1+
From elpi_stdlib Require Import Bool.
22
From elpi.apps Require Import tc.
33

44
Class Eqb (T: Type) := {
@@ -93,4 +93,5 @@ Module Backtrack.
9393
End Backtrack.
9494

9595
TC.Print_instances.
96-
TC.Get_class_info DecidableClass.Decidable.
96+
(* Require Stdlib *)
97+
(* TC.Get_class_info DecidableClass.Decidable. *)

apps/tc/tests/bench/bench_inj.py renamed to apps/tc/tests-stdlib/bench/bench_inj.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def buildTree(len):
8989

9090
def writeFile(fileName: str, composeLen: int, isCoq: bool):
9191
PREAMBLE = f"""\
92-
From elpi.apps.tc.tests Require Import {"stdppInjClassic" if isCoq else "stdppInj"}.
92+
From elpi_apps_tc_tests_stdlib Require Import {"stdppInjClassic" if isCoq else "stdppInj"}.
9393
{"" if isCoq else 'Elpi TC.Solver. Set TC Time Refine. Set TC Time Instance Search. Set TC Time Build Query. Set Debug "elpitime".'}
9494
"""
9595
GOAL = buildTree(composeLen)
@@ -130,4 +130,4 @@ def loopTreeDepth(file_name: str, maxHeight: int, makeCoq=True, onlyOne=False):
130130
height = int(sys.argv[1])
131131
loopTreeDepth(file_name, height, makeCoq=not (
132132
"-nocoq" in sys.argv), onlyOne=("-onlyOne" in sys.argv))
133-
#writeFile(file_name, 1, False)
133+
#writeFile(file_name, 1, False)
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
From elpi.apps.tc.tests Require Import stdppInj.
1+
From elpi_apps_tc_tests_stdlib Require Import stdppInj.
22
Elpi TC.Solver. Set TC Time Refine. Set TC Time Instance Search. Set Debug "elpitime".
33
Goal Inj eq eq((compose f f )). Time apply _. Qed.

0 commit comments

Comments
 (0)