Skip to content

Commit

Permalink
Reduce test suite duplication.
Browse files Browse the repository at this point in the history
  • Loading branch information
athas committed Jul 26, 2024
1 parent 517b4e8 commit 2075f89
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 211 deletions.
9 changes: 6 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,16 @@ test_mlton_mono/test.sml: test/test.json smlfut
test_mlkit/test.sml: test/test.json smlfut
./smlfut --target=mlkit test/test.json -o test_mlkit

test_mlkit/test: test/test.json test_mlkit/test_main.sml test_mlkit/test.sml
test_mlkit/test: test/test.json test/test_mono.sml test_mlkit/test.sml
cd test_mlkit && gcc -c ../test/test.c test.smlfut.c
cd test_mlkit && ar r libtest.a test.o test.smlfut.o
$(MLKIT) -o test_mlkit/test -libdirs test_mlkit -libs "m,c,dl,test" -no_gc test_mlkit/test.mlb

%/test: test/test.json %/test_main.sml %/test.sml
$(MLTON) $(MLTONFLAGS) $*/test.mlb test/test.c $*/test.smlfut.c
test_mlton_mono/test: test/test.json test/test_mono.sml test_mlton_mono/test.sml
$(MLTON) $(MLTONFLAGS) test_mlton_mono/test.mlb test/test.c test_mlton_mono/test.smlfut.c

test_mlton_poly/test: test/test.json test/test_mono.sml test_mlton_poly/test.sml
$(MLTON) $(MLTONFLAGS) test_mlton_poly/test.mlb test/test.c test_mlton_poly/test.smlfut.c

run_test_mlton_poly: test_mlton_poly/test
cd test_mlton_poly && ./test
Expand Down
3 changes: 2 additions & 1 deletion test_mlkit/test_main.sml → test/test_mono.sml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
structure Futhark = test
(* Generic tests for backends that use monomorphic arrays. *)

structure Futhark = test
functor ArrayTest (structure A: MONO_ARRAY; val eq: A.elem * A.elem -> bool) :>
sig
val equal: A.array -> A.array -> bool
Expand Down
2 changes: 1 addition & 1 deletion test_mlkit/test.mlb
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@ local $(SML_LIB)/basis/basis.mlb
in
test.sig
test.sml
test_main.sml
../test/test_mono.sml
end
2 changes: 1 addition & 1 deletion test_mlton_mono/test.mlb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@ local $(SML_LIB)/basis/basis.mlb
in
test.sig
test.sml
test_main.sml
../test/test_mono.sml
end

205 changes: 0 additions & 205 deletions test_mlton_mono/test_main.sml

This file was deleted.

0 comments on commit 2075f89

Please sign in to comment.