diff --git a/interpreter/dune-project b/dune-project similarity index 100% rename from interpreter/dune-project rename to dune-project diff --git a/interpreter/Makefile b/interpreter/Makefile index 4ff333d177..78fce53d84 100644 --- a/interpreter/Makefile +++ b/interpreter/Makefile @@ -27,7 +27,7 @@ JS = # set to JS shell command to run JS tests # Main targets -.PHONY: default opt unopt libopt libunopt jslib all land zip smallint +.PHONY: default opt unopt libopt libunopt jslib all land zip smallint dunebuild default: opt debug: unopt @@ -41,6 +41,8 @@ land: $(WINMAKE) all zip: $(ZIP) smallint: smallint.native +dunebuild: + dune build # Building executable @@ -136,7 +138,7 @@ TESTDIR = ../test/core TESTFILES = $(shell cd $(TESTDIR); ls *.wast; ls [a-z]*/*.wast) TESTS = $(TESTFILES:%.wast=%) -.PHONY: test debugtest partest +.PHONY: test debugtest partest dune-test test: $(OPT) smallint $(TESTDIR)/run.py --wasm `pwd`/$(OPT) $(if $(JS),--js '$(JS)',) @@ -168,6 +170,9 @@ quiettest/%: $(OPT) smallinttest: smallint @./smallint.native +dunetest: + dune test + # Miscellaneous targets .PHONY: clean diff --git a/interpreter/dune b/interpreter/dune index 2b5cd3572d..6f6dfff3e0 100644 --- a/interpreter/dune +++ b/interpreter/dune @@ -3,10 +3,11 @@ (library (name wasm) ; The 'main' module shall not be part of the library, as it would start the - ; WASM REPL every time in all the dependencies. + ; Wasm REPL every time in all the dependencies. ; We also need to exclude the 'wasm' module as it overlaps with the library ; name. - (modules :standard \ main wasm)) + ; 'smallint' is a separate test module. + (modules :standard \ main wasm smallint)) (executable (name main) @@ -15,6 +16,13 @@ (flags (-open Wasm))) +(executable + (name smallint) + (modules smallint) + (libraries wasm) + (flags + (-open Wasm))) + (subdir text (rule @@ -28,6 +36,17 @@ (modules parser))) (env - (dev + (_ (flags - (-w +a-4-27-42-44-45 -warn-error +a-3)))) + (-w +a-4-27-42-44-45-70 -warn-error +a-3)))) + +(rule + (alias runtest) + (deps + ./main.exe + ./smallint.exe + (source_tree ../test)) + (action + (progn + (run ../test/core/run.py --wasm ./main.exe) + (run ./smallint.exe))))