summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile83
1 files changed, 69 insertions, 14 deletions
diff --git a/Makefile b/Makefile
index 6dba57fa..d91f59e0 100644
--- a/Makefile
+++ b/Makefile
@@ -15,9 +15,7 @@ test_raw_sys := 25
# Convert chapter numbers to test files
test_raw0 := $(patsubst %,com.seaofnodes.simple.Chapter%Test,$(test_raw_nums0))
test_raw1 := $(patsubst %,com.seaofnodes.simple.Chapter%Test,$(test_raw_nums1))
-# TimeTest uses sys and compiles a wide library. Keep it out of the catch-all
-# JVM, whose accumulated pooled types can exhaust this snapshot's 16-bit IDs.
-test_sys := $(patsubst %,com.seaofnodes.simple.Chapter%Test,$(test_raw_sys) ) com.seaofnodes.simple.TimeTest
+test_sys := $(patsubst %,com.seaofnodes.simple.Chapter%Test,$(test_raw_sys) )
# All the 'src/test/java' files ending in 'Test'
test_cp0 := $(patsubst $(TST)/$(SIMPLE)/%.java,com.seaofnodes.simple.%,$(wildcard $(TST)/$(SIMPLE)/*Test.java))
# Minus raw0, raw1, alone tests
@@ -27,6 +25,37 @@ test_cp3 := $(filter-out $(test_alone),$(test_cp2))
test_cp4 := $(filter-out com.seaofnodes.simple.Chapter25Test,$(test_cp3))
test_cp := $(filter-out $(test_sys) ,$(test_cp4))
+# Measured groups keep class fixtures together. New tests join group 7 rather
+# than silently falling out of the suite. Each group has private native outputs.
+test_group0 := com.seaofnodes.simple.DrawTest
+test_group1 := com.seaofnodes.simple.GraphicsTest
+test_group2 := $(addprefix com.seaofnodes.simple.,TimeTest MemoryEncodingTest ChainedComparisonTest ParserTest Chapter28bTest)
+test_group3 := $(addprefix com.seaofnodes.simple.,StringFormatTest StaticDataTest PhaseTest FinalConstructionTest PartialReadTest EscapeFlowTest CallEndTest BulkMemPhiTest)
+test_group4 := $(addprefix com.seaofnodes.simple.,BreakoutTest ConvertNodeTest ArithNodeTest MethodAccessTest Int32Test MinusNodeTest ConstructorCompletionTest)
+test_group5 := $(addprefix com.seaofnodes.simple.,TerminalInputTest ParserDiagnosticTest ArrayInitTest MethodFieldsTest ConstantArrayTest BoundaryTest IntegerLiteralTest ConstructionRequirementsTest)
+test_group6 := $(addprefix com.seaofnodes.simple.,AssemblyDumpTest AudioTest MathTest TicTacToeTest ModTest SelectiveLoadingTest FloatComparisonNativeTest SchedulingTest SeparateCompilationTest ConstructionGroupTest CompoundAssignmentTest)
+test_group7 := $(filter-out $(test_group0) $(test_group1) $(test_group2) $(test_group3) $(test_group4) $(test_group5) $(test_group6),$(test_cp))
+test_groups := $(addprefix tests_group,0 1 2 3 4 5 6 7)
+
+# Fast compiler checks retain the full lattice, chapter/backend regressions,
+# fuzzer regression seeds, and focused compiler tests. Library/application and
+# CLI integration remains in `tests`. New compiler tests join sanity group 2.
+sanity_omit := $(addprefix com.seaofnodes.simple.,DrawTest GraphicsTest TimeTest StringFormatTest BreakoutTest TerminalInputTest AudioTest MathTest TicTacToeTest StreamIOTest RuntimeArgsTest NativeExecutionTest ParserDiagnosticTest)
+sanity_cp := $(filter-out $(sanity_omit),$(test_cp))
+sanity_group0 := $(addprefix com.seaofnodes.simple.,ClassInitDependenciesTest ConvertNodeTest ArithNodeTest MemoryEncodingTest ModTest IntrinsicTest AssemblyDumpTest)
+sanity_group1 := $(addprefix com.seaofnodes.simple.,StaticDataTest FloatComparisonNativeTest ArrayInitTest ConstantArrayTest BoundaryTest Int32Test ReceiverTest GlobalAssignmentTest IncrementalBuildTest SeparateCompilationTest)
+sanity_group2 := $(filter-out $(sanity_group0) $(sanity_group1),$(sanity_cp))
+sanity_groups := $(addprefix sanity_group,0 1 2)
+
+# Size each test JVM for a share of the machine, instead of giving every JVM
+# JIT and GC pools sized for all cores. Absolute paths also serve child JVMs
+# launched from a group's private working directory (native Java on Windows).
+TEST_JAVA_OPTS ?= -XX:ActiveProcessorCount=2
+test_path = $(if $(filter Windows_NT,$(OS)),$(shell cygpath -m "$(abspath $(1))"),$(abspath $(1)))
+test_classpath := $(subst $(space),$(SEP),$(foreach path,$(CLZDIR)/main $(libs) $(CLZDIR)/test,$(call test_path,$(path))))
+TEST_JVM = nice java -ea $(TEST_JAVA_OPTS) -cp "$(test_classpath)"
+fuzzer: private JVM = $(TEST_JVM)
+
# Default Simple .o target is build/objs which is where all the test .o's get
# dumped. The default sys search needs to NOT include all the dumped test
# files; move it down into lib/
@@ -98,41 +127,67 @@ tests_nographics:
#######################################################
# Base launch line for JVM tests
+.PHONY: tests_raw0 tests_raw1 tests_alone tests_programs tests_sys $(test_groups) tests_lattice0 tests_lattice1 tests_lattice2 tests_lattice3
# Tests that do NOT need sys.smp
tests_raw0: $(CLZDIR)/main/.mtag $(CLZDIR)/test/.ttag $(RELEASE_CRT)
@echo "testing " $(test_raw0)
@[ -d $(OBJS) ] || mkdir -p $(OBJS)
- @$(JVM) org.junit.runner.JUnitCore $(test_raw0)
+ @$(TEST_JVM) org.junit.runner.JUnitCore $(test_raw0)
tests_raw1: $(CLZDIR)/main/.mtag $(CLZDIR)/test/.ttag $(RELEASE_CRT)
@echo "testing " $(test_raw1)
@[ -d $(OBJS) ] || mkdir -p $(OBJS)
- @$(JVM) org.junit.runner.JUnitCore $(test_raw1)
+ @$(TEST_JVM) org.junit.runner.JUnitCore $(test_raw1)
# Larger regressions, including BrainFuck's standard-library buffer variant.
-tests_alone: $(main_classes) $(test_classes) $(RELEASE_SYS) $(RELEASE_CRT)
- @echo "testing " $(test_alone)
+tests_alone: tests_programs tests_lattice0 tests_lattice1 tests_lattice2 tests_lattice3
+tests_programs: $(main_classes) $(test_classes) $(RELEASE_SYS) $(RELEASE_CRT)
+ @echo "testing " $(filter-out com.seaofnodes.simple.TypeTest,$(test_alone))
@[ -d $(OBJS) ] || mkdir -p $(OBJS)
- @$(JVM) org.junit.runner.JUnitCore $(test_alone)
+ @$(TEST_JVM) org.junit.runner.JUnitCore $(filter-out com.seaofnodes.simple.TypeTest,$(test_alone))
+
+# Partition the lattice's outer type loop across processes: type interning and
+# cyclic traversal scratch state are shared mutable data within a JVM. Part 0
+# runs the other TypeTest methods too; direct JUnit/IDE runs still check it all.
+tests_lattice0: $(test_classes)
+ @echo "testing lattice part 0/4 and other type checks"
+ @$(TEST_JVM) -Dsimple.lattice.parts=4 -Dsimple.lattice.part=0 org.junit.runner.JUnitCore com.seaofnodes.simple.TypeTest
+tests_lattice1 tests_lattice2 tests_lattice3: tests_lattice%: $(test_classes)
+ @echo "testing lattice part $*/4"
+ @$(TEST_JVM) -Dsimple.lattice.parts=4 -Dsimple.lattice.part=$* com.seaofnodes.simple.TestRunner TypeTest testLatticeTheory
# Tests that DO need sys.smp
tests_sys: $(main_classes) $(test_classes) $(RELEASE_SYS) $(RELEASE_CRT)
@echo "testing " $(test_sys)
@[ -d $(OBJS) ] || mkdir -p $(OBJS)
- @$(JVM) org.junit.runner.JUnitCore $(test_sys)
+ @$(TEST_JVM) org.junit.runner.JUnitCore $(test_sys)
+
+$(test_groups): tests_group%: $(test_classes) $(TEST_SYS) $(RELEASE_SYS) $(RELEASE_CRT)
+ @$(TEST_JVM) com.seaofnodes.simple.TestWorkspace $@ $(CPU_ABI)
+ @echo "testing $@: $(test_group$*)"
+ @cd build/tests/$@ && $(TEST_JVM) org.junit.runner.JUnitCore $(test_group$*)
+
+.PHONY: sanity $(sanity_groups)
+$(sanity_groups): sanity_group%: $(test_classes) $(TEST_SYS) $(RELEASE_SYS) $(RELEASE_CRT)
+ @$(TEST_JVM) com.seaofnodes.simple.TestWorkspace $@ $(CPU_ABI)
+ @echo "testing $@: $(sanity_group$*)"
+ @cd build/tests/$@ && $(TEST_JVM) org.junit.runner.JUnitCore $(sanity_group$*)
+
+sanity: $(sanity_groups) tests_raw0 tests_raw1 fuzzer tests_lattice0 tests_lattice1 tests_lattice2 tests_lattice3
+ @echo "All sanity checks passed"
# One test method (or the whole class when METHOD is omitted).
CLASS ?= Chapter25Test
METHOD ?=
.PHONY: test
test: $(main_classes) $(test_classes) $(RELEASE_SYS) $(RELEASE_CRT)
- @$(JVM) com.seaofnodes.simple.TestRunner "$(CLASS)" "$(METHOD)"
+ @$(TEST_JVM) com.seaofnodes.simple.TestRunner "$(CLASS)" "$(METHOD)"
-tests: $(CLZDIR)/main/.mtag $(CLZDIR)/test/.ttag tests_raw0 tests_raw1 tests_alone tests_sys fuzzer
- @echo "All tests"
- @[ -d $(OBJS) ] || mkdir -p $(OBJS)
- @$(JVM) org.junit.runner.JUnitCore $(test_cp)
+# At -j8, start the remaining chapter cohorts before the short lattice parts
+# so their native links overlap the earlier groups instead of forming a tail.
+tests: $(test_groups) tests_sys fuzzer tests_raw1 tests_raw0 tests_alone
+ @echo "All tests passed"
# Build a Simple jar and release stdlib