Skip to content

Commit 1b849c7

Browse files
authored
[interpreter] Dune test suite (#1478)
1 parent 656e20a commit 1b849c7

File tree

3 files changed

+30
-6
lines changed

3 files changed

+30
-6
lines changed
File renamed without changes.

interpreter/Makefile

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ JS = # set to JS shell command to run JS tests
2727

2828
# Main targets
2929

30-
.PHONY: default opt unopt libopt libunopt jslib all land zip smallint
30+
.PHONY: default opt unopt libopt libunopt jslib all land zip smallint dunebuild
3131

3232
default: opt
3333
debug: unopt
@@ -41,6 +41,8 @@ land: $(WINMAKE) all
4141
zip: $(ZIP)
4242
smallint: smallint.native
4343

44+
dunebuild:
45+
dune build
4446

4547
# Building executable
4648

@@ -136,7 +138,7 @@ TESTDIR = ../test/core
136138
TESTFILES = $(shell cd $(TESTDIR); ls *.wast; ls [a-z]*/*.wast)
137139
TESTS = $(TESTFILES:%.wast=%)
138140
139-
.PHONY: test debugtest partest
141+
.PHONY: test debugtest partest dune-test
140142
141143
test: $(OPT) smallint
142144
$(TESTDIR)/run.py --wasm `pwd`/$(OPT) $(if $(JS),--js '$(JS)',)
@@ -168,6 +170,9 @@ quiettest/%: $(OPT)
168170
smallinttest: smallint
169171
@./smallint.native
170172
173+
dunetest:
174+
dune test
175+
171176
# Miscellaneous targets
172177
173178
.PHONY: clean

interpreter/dune

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@
33
(library
44
(name wasm)
55
; The 'main' module shall not be part of the library, as it would start the
6-
; WASM REPL every time in all the dependencies.
6+
; Wasm REPL every time in all the dependencies.
77
; We also need to exclude the 'wasm' module as it overlaps with the library
88
; name.
9-
(modules :standard \ main wasm))
9+
; 'smallint' is a separate test module.
10+
(modules :standard \ main wasm smallint))
1011

1112
(executable
1213
(name main)
@@ -15,6 +16,13 @@
1516
(flags
1617
(-open Wasm)))
1718

19+
(executable
20+
(name smallint)
21+
(modules smallint)
22+
(libraries wasm)
23+
(flags
24+
(-open Wasm)))
25+
1826
(subdir
1927
text
2028
(rule
@@ -28,6 +36,17 @@
2836
(modules parser)))
2937

3038
(env
31-
(dev
39+
(_
3240
(flags
33-
(-w +a-4-27-42-44-45 -warn-error +a-3))))
41+
(-w +a-4-27-42-44-45-70 -warn-error +a-3))))
42+
43+
(rule
44+
(alias runtest)
45+
(deps
46+
./main.exe
47+
./smallint.exe
48+
(source_tree ../test))
49+
(action
50+
(progn
51+
(run ../test/core/run.py --wasm ./main.exe)
52+
(run ./smallint.exe))))

0 commit comments

Comments
 (0)