ref: 47379f4817611557050ea97fba59eb2821421109
parent: 019086e932dd150fbdb1826b8d55b813191e6e93
author: Lennart Augustsson <lennart.augustsson@epicgames.com>
date: Mon Nov 27 08:48:00 EST 2023
More testing stuff
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@
GHCPROF= # -prof -fprof-late #-prof -fprof-auto
GHCFLAGS= $(GHCEXTS) $(GHCINCS) $(GHCWARNS) $(GHCOPTS) $(GHCTOOL) $(GHCPKGS) $(GHCOUT) $(GHCPROF)
#
-.PHONY: clean bootstrap install ghcgen newmhs cachelib timecompile exampletest
+.PHONY: clean bootstrap install ghcgen newmhs cachelib timecompile exampletest cachetest runtest runtestmhs everytest everytestmhs
all: bin/mhs
@@ -106,6 +106,11 @@
@echo "***"
everytest: runtest bootcombtest exampletest cachetest
+
+everytestmhs: runtestmhs bootcombtest exampletest cachetest
+
+runtestmhs:
+ cd tests; make MHS=../bin/mhs cache; make MHS="../bin/mhs -c" alltest
bootcombtest: bin/gmhs bin/mhseval
bin/gmhs -ilib -isrc -ogmhs.comb MicroHs.Main
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -1,39 +1,44 @@
-MHS=../bin/gmhs -i../lib
+MHS=../bin/gmhs
+TMHS=$(MHS) -i../lib
EVAL=../bin/mhseval
-.PHONY: test time clean errtest alltest
+.PHONY: test time clean errtest alltest cache
alltest: test errtest
+cache:
+ rm -f .mhscache
+ $(TMHS) -c AllOfLib
+
test:
- $(MHS) Hello && $(EVAL) > Hello.out && diff Hello.ref Hello.out
- $(MHS) IOTest && (echo q | $(EVAL) a bb ccc | sed 's/^.ms/1ms/' > IOTest.out) && diff IOTest.ref IOTest.out
- $(MHS) StringTest && $(EVAL) > StringTest.out && diff StringTest.ref StringTest.out
- $(MHS) ListTest && $(EVAL) > ListTest.out && diff ListTest.ref ListTest.out
- $(MHS) Fac && $(EVAL) > Fac.out && diff Fac.ref Fac.out
- $(MHS) Misc && $(EVAL) > Misc.out && diff Misc.ref Misc.out
- $(MHS) Case && $(EVAL) > Case.out && diff Case.ref Case.out
- $(MHS) Arith && $(EVAL) > Arith.out && diff Arith.ref Arith.out
- $(MHS) Guard && $(EVAL) > Guard.out && diff Guard.ref Guard.out
- $(MHS) Newtype && $(EVAL) > Newtype.out && diff Newtype.ref Newtype.out
- $(MHS) LitMatch && $(EVAL) > LitMatch.out && diff LitMatch.ref LitMatch.out
- $(MHS) Word && $(EVAL) > Word.out && diff Word.ref Word.out
- $(MHS) Enum && $(EVAL) > Enum.out && diff Enum.ref Enum.out
- $(MHS) Foreign && $(EVAL) > Foreign.out && diff Foreign.ref Foreign.out
- $(MHS) MutRec && $(EVAL) > MutRec.out && diff MutRec.ref MutRec.out
- $(MHS) LocalPoly && $(EVAL) > LocalPoly.out && diff LocalPoly.ref LocalPoly.out
- $(MHS) Rank2 && $(EVAL) > Rank2.out && diff Rank2.ref Rank2.out
- $(MHS) Catch && $(EVAL) > Catch.out && diff Catch.ref Catch.out
- $(MHS) FArith && $(EVAL) > FArith.out && diff FArith.ref FArith.out
- $(MHS) Infix && $(EVAL) > Infix.out && diff Infix.ref Infix.out
- $(MHS) Class && $(EVAL) > Class.out && diff Class.ref Class.out
- $(MHS) Eq && $(EVAL) > Eq.out && diff Eq.ref Eq.out
- $(MHS) Floating && $(EVAL) > Floating.out && diff Floating.ref Floating.out
- $(MHS) Default && $(EVAL) > Default.out && diff Default.ref Default.out
- $(MHS) Multi && $(EVAL) > Multi.out && diff Multi.ref Multi.out
- $(MHS) Exists && $(EVAL) > Exists.out && diff Exists.ref Exists.out
- $(MHS) TypeEq && $(EVAL) > TypeEq.out && diff TypeEq.ref TypeEq.out
- $(MHS) Sieve && $(EVAL) > Sieve.out && diff Sieve.ref Sieve.out
- $(MHS) Dict && $(EVAL) > Dict.out && diff Dict.ref Dict.out
+ $(TMHS) Hello && $(EVAL) > Hello.out && diff Hello.ref Hello.out
+ $(TMHS) IOTest && (echo q | $(EVAL) a bb ccc | sed 's/^.ms/1ms/' > IOTest.out) && diff IOTest.ref IOTest.out
+ $(TMHS) StringTest && $(EVAL) > StringTest.out && diff StringTest.ref StringTest.out
+ $(TMHS) ListTest && $(EVAL) > ListTest.out && diff ListTest.ref ListTest.out
+ $(TMHS) Fac && $(EVAL) > Fac.out && diff Fac.ref Fac.out
+ $(TMHS) Misc && $(EVAL) > Misc.out && diff Misc.ref Misc.out
+ $(TMHS) Case && $(EVAL) > Case.out && diff Case.ref Case.out
+ $(TMHS) Arith && $(EVAL) > Arith.out && diff Arith.ref Arith.out
+ $(TMHS) Guard && $(EVAL) > Guard.out && diff Guard.ref Guard.out
+ $(TMHS) Newtype && $(EVAL) > Newtype.out && diff Newtype.ref Newtype.out
+ $(TMHS) LitMatch && $(EVAL) > LitMatch.out && diff LitMatch.ref LitMatch.out
+ $(TMHS) Word && $(EVAL) > Word.out && diff Word.ref Word.out
+ $(TMHS) Enum && $(EVAL) > Enum.out && diff Enum.ref Enum.out
+ $(TMHS) Foreign && $(EVAL) > Foreign.out && diff Foreign.ref Foreign.out
+ $(TMHS) MutRec && $(EVAL) > MutRec.out && diff MutRec.ref MutRec.out
+ $(TMHS) LocalPoly && $(EVAL) > LocalPoly.out && diff LocalPoly.ref LocalPoly.out
+ $(TMHS) Rank2 && $(EVAL) > Rank2.out && diff Rank2.ref Rank2.out
+ $(TMHS) Catch && $(EVAL) > Catch.out && diff Catch.ref Catch.out
+ $(TMHS) FArith && $(EVAL) > FArith.out && diff FArith.ref FArith.out
+ $(TMHS) Infix && $(EVAL) > Infix.out && diff Infix.ref Infix.out
+ $(TMHS) Class && $(EVAL) > Class.out && diff Class.ref Class.out
+ $(TMHS) Eq && $(EVAL) > Eq.out && diff Eq.ref Eq.out
+ $(TMHS) Floating && $(EVAL) > Floating.out && diff Floating.ref Floating.out
+ $(TMHS) Default && $(EVAL) > Default.out && diff Default.ref Default.out
+ $(TMHS) Multi && $(EVAL) > Multi.out && diff Multi.ref Multi.out
+ $(TMHS) Exists && $(EVAL) > Exists.out && diff Exists.ref Exists.out
+ $(TMHS) TypeEq && $(EVAL) > TypeEq.out && diff TypeEq.ref TypeEq.out
+ $(TMHS) Sieve && $(EVAL) > Sieve.out && diff Sieve.ref Sieve.out
+ $(TMHS) Dict && $(EVAL) > Dict.out && diff Dict.ref Dict.out
errtest:
sh errtester.sh < errmsg.test
@@ -40,7 +45,7 @@
time:
@echo Expect about 10s runtime
- $(MHS) Nfib && time -p $(EVAL)
+ $(TMHS) Nfib && time -p $(EVAL)
clean:
rm -f *.out *.tmp
--
⑨