Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 1 addition & 7 deletions spectec/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -72,15 +72,9 @@ doc/example: exe
@(cd $@ && make out clean >$(LOG) 2>&1 && rm -f $(LOG))


# Specification (copy to local workspace to make dune deps for tests happy)
# Specification

SPECIFICATIONDIR = $(ROOTDIR)/specification
SPECCLONEDIR = _specification

$(SPECCLONEDIR): $(shell find $(SPECIFICATIONDIR) -type f)
rm -rf $(SPECCLONEDIR)
cp -R $(SPECIFICATIONDIR) $(SPECCLONEDIR)


# Spec document

Expand Down
1 change: 1 addition & 0 deletions spectec/specification
2 changes: 1 addition & 1 deletion spectec/src/exe-spectec/dune
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
(executable
(name main)
(libraries spectec)
)
)
11 changes: 2 additions & 9 deletions spectec/test-frontend/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LOG = _log

OWNDIR = $(PWD)
SPECDIR = ../../specification
SPECCLONE = ../_specification
SPECFILES = $(shell cd $(SPECDIR) && ls -d wasm-*)
TESTFILES = $(shell ls *.$(EXT))
SPECS = $(SPECFILES:%=test-%)
Expand All @@ -28,8 +27,8 @@ all: test

test: $(SPECS) $(TESTS)

$(SPECS): test-%: $(SPECCLONE) $(EXE)
(cd $(SPECCLONE)/$* && $(EXE) -l *.$(EXT))
$(SPECS): test-%: $(SPECDIR) $(EXE)
(cd $(SPECDIR)/$* && $(EXE) -l *.$(EXT))

$(TESTS): test-%: %.$(EXT) $(EXE)
($(EXE) -l $<)
Expand All @@ -43,12 +42,6 @@ exe:
@(cd ..; make exe)


# Specification

$(SPECCLONE): $(SPECDEPFILES)
@(cd ..; make _specification)


# Cleanup

.PHONY: clean distclean
Expand Down
2 changes: 1 addition & 1 deletion spectec/test-frontend/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(libraries spectec)
(deps
(file ../src/exe-spectec/main.exe)
(glob_files_rec ../_specification/*)
(glob_files ../specification/wasm-3.0/*)
(file test.spectec)
)
(files TEST.md)
Expand Down
11 changes: 2 additions & 9 deletions spectec/test-interpreter/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LOG = _log

OWNDIR = $(PWD)
SPECDIR = ../../specification/wasm-3.0
SPECCLONE = ../_specification/wasm-3.0
SPECFILES = $(shell ls $(SPECDIR)/*.$(EXT))


Expand All @@ -22,8 +21,8 @@ all: test

.PHONY: test

test: $(SPECCLONE) $(EXE)
(cd $(SPECCLONE) && $(EXE) -l *.$(EXT))
test: $(SPECDIR) $(EXE)
(cd $(SPECDIR) && $(EXE) -l *.$(EXT))


# Executable
Expand All @@ -34,12 +33,6 @@ exe:
@(cd ..; make exe)


# Specification

$(SPECCLONE): $(SPECFILES)
@(cd ..; make _specification)


# Cleanup

.PHONY: clean distclean
Expand Down
8 changes: 4 additions & 4 deletions spectec/test-interpreter/TEST.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Preview

```sh
$ ../src/exe-spectec/main.exe ../../../_specification/wasm-3.0/*.spectec -v -l --interpreter ../test-interpreter/sample.wat addTwo 30 12 2>&1
$ ../src/exe-spectec/main.exe ../../../specification/wasm-3.0/*.spectec -v -l --interpreter ../test-interpreter/sample.wat addTwo 30 12 2>&1
spectec 0.5 generator
== Parsing...
== Elaboration...
Expand All @@ -14,7 +14,7 @@ spectec 0.5 generator
===== ../test-interpreter/sample.wat =====
42
== Complete.
$ ../src/exe-spectec/main.exe ../../../_specification/wasm-3.0/*.spectec -v -l --interpreter ../test-interpreter/sample.wasm addTwo 40 2 2>&1
$ ../src/exe-spectec/main.exe ../../../specification/wasm-3.0/*.spectec -v -l --interpreter ../test-interpreter/sample.wasm addTwo 40 2 2>&1
spectec 0.5 generator
== Parsing...
== Elaboration...
Expand All @@ -27,7 +27,7 @@ spectec 0.5 generator
===== ../test-interpreter/sample.wasm =====
42
== Complete.
$ ../src/exe-spectec/main.exe ../../../_specification/wasm-3.0/*.spectec -v -l --interpreter ../test-interpreter/sample.wast 2>&1
$ ../src/exe-spectec/main.exe ../../../specification/wasm-3.0/*.spectec -v -l --interpreter ../test-interpreter/sample.wast 2>&1
spectec 0.5 generator
== Parsing...
== Elaboration...
Expand All @@ -44,7 +44,7 @@ spectec 0.5 generator
== Complete.
$ for v in 1 2 3; do ( \
> echo "Running test for Wasm $v.0..." && \
> ../src/exe-spectec/main.exe ../../../_specification/wasm-$v.0/*.spectec -v -l --test-version $v --interpreter ../test-interpreter/spec-test-$v \
> ../src/exe-spectec/main.exe ../../../specification/wasm-$v.0/*.spectec -v -l --test-version $v --interpreter ../test-interpreter/spec-test-$v \
> ) done 2>&1
Running test for Wasm 1.0...
spectec 0.5 generator
Expand Down
4 changes: 3 additions & 1 deletion spectec/test-interpreter/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@
(libraries spectec)
(deps
(file ../src/exe-spectec/main.exe)
(glob_files_rec ../_specification/*)
(glob_files ../specification/wasm-1.0/*)
(glob_files ../specification/wasm-2.0/*)
(glob_files ../specification/wasm-3.0/*)
(source_tree spec-test-1)
(source_tree spec-test-2)
(source_tree spec-test-3)
Expand Down
11 changes: 2 additions & 9 deletions spectec/test-latex/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ LOG = _log

OWNDIR = $(PWD)
SPECDIR = ../../specification
SPECCLONE = ../_specification
SPECS = $(shell cd $(SPECDIR) && ls -d wasm-*)
SPECFILES = $(shell ls $(SPECS:%=$(SPECDIR)/%/*.$(EXT)))
TESTFILES = $(shell ls *.$(EXT))
Expand Down Expand Up @@ -40,8 +39,8 @@ gen: $(SPECS:%=$(GENINNAME)-%.tex)

test-gen: $(SPECS:%=$(GENOUTNAME)-%.pdf) test-test

$(GENINNAME)-%.tex: $(SPECCLONE) $(EXE)
(cd $(SPECCLONE)/$* && $(EXE) -l --latex *.$(EXT) -o $(OWNDIR)/$@)
$(GENINNAME)-%.tex: $(EXE)
(cd $(SPECDIR)/$* && $(EXE) -l --latex *.$(EXT) -o $(OWNDIR)/$@)

$(GENOUTNAME)-%.tex: $(GENOUTNAME).tex
ln -f $< $@
Expand Down Expand Up @@ -71,12 +70,6 @@ exe:
@(cd ..; make exe)


# Specification

$(SPECCLONE): $(SPECFILES)
@(cd ..; make _specification)


# Cleanup

.PHONY: clean distclean
Expand Down
2 changes: 1 addition & 1 deletion spectec/test-latex/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(libraries spectec)
(deps
(file ../src/exe-spectec/main.exe)
(glob_files_rec ../_specification/*)
(glob_files ../specification/wasm-3.0/*)
(file test.spectec)
)
(files TEST.md)
Expand Down
Loading