Cleanup some Makefiles
314d754f3ef89f598974f46da741d267fb7144ce7e4a0799fe4ab8019de24b55
1 parent
c7176c83
Makefile
+1 -1
| 15 | 15 | RAD_EMULATOR ?= emulator |
|
| 16 | 16 | export RAD_EMULATOR |
|
| 17 | 17 | ||
| 18 | 18 | # Command that runs hosted build tools with the memory and stack limits in |
|
| 19 | 19 | # `seed/emulator-args`. |
|
| 20 | - | HOSTED := $(RAD_EMULATOR) $(shell cat seed/emulator-args) -count-instructions -run |
|
| 20 | + | HOSTED := $(RAD_EMULATOR) $(shell cat seed/emulator-args) -run |
|
| 21 | 21 | RADIANCE := $(HOSTED) $(RAD_BIN) |
|
| 22 | 22 | ||
| 23 | 23 | default: $(RAD_BIN) |
|
| 24 | 24 | ||
| 25 | 25 | # Compiler build |
test/Makefile
+29 -34
| 1 | 1 | # Test suites and machine fixture matrix. Run from the repository root. |
|
| 2 | 2 | # JOBS controls workers in the integration driver. |
|
| 3 | - | JOBS ?= 1 |
|
| 3 | + | JOBS ?= 1 |
|
| 4 | 4 | TEST_HARTS := 1 2 8 |
|
| 5 | 5 | SMP_TESTS := $(addprefix smp-test-,$(TEST_HARTS)) |
|
| 6 | 6 | CYCLES_TESTS := $(addprefix cycles-test-,$(TEST_HARTS)) |
|
| 7 | - | TESTS := seed-test std-test fmt-test host-test bin-test \ |
|
| 8 | - | module-test \ |
|
| 9 | - | native-test shared-test sync-test verify-test kernel-test \ |
|
| 10 | - | kernel-boot-test trap-test loader-test dispatch-test $(SMP_TESTS) \ |
|
| 11 | - | termination-test runtime-test bootstrap-test scheduling-test mmio-test \ |
|
| 12 | - | $(CYCLES_TESTS) |
|
| 7 | + | TESTS := \ |
|
| 8 | + | seed-test \ |
|
| 9 | + | std-test \ |
|
| 10 | + | fmt-test \ |
|
| 11 | + | host-test \ |
|
| 12 | + | bin-test \ |
|
| 13 | + | module-test \ |
|
| 14 | + | native-test \ |
|
| 15 | + | shared-test \ |
|
| 16 | + | sync-test \ |
|
| 17 | + | verify-test \ |
|
| 18 | + | kernel-test \ |
|
| 19 | + | kernel-boot-test \ |
|
| 20 | + | trap-test loader-test \ |
|
| 21 | + | dispatch-test \ |
|
| 22 | + | smp-test \ |
|
| 23 | + | termination-test \ |
|
| 24 | + | runtime-test \ |
|
| 25 | + | bootstrap-test \ |
|
| 26 | + | scheduling-test \ |
|
| 27 | + | mmio-test \ |
|
| 28 | + | cycles-test |
|
| 13 | 29 | ||
| 14 | 30 | test: $(TESTS) |
|
| 15 | - | .PHONY: test $(TESTS) smp-test cycles-test clean-std-test clean-bin-test |
|
| 16 | 31 | ||
| 17 | 32 | # Hosted test tools share one compiler recipe. |
|
| 18 | 33 | # Runner binary: the lowering IL checker. |
|
| 19 | 34 | TEST_TOOL_SRC := test/runner.rad test/native/build.rad \ |
|
| 20 | 35 | test/shared/build.rad test/sync/build.rad test/loader/hostile.rad \ |
| 93 | 108 | @$(call integration,sync) |
|
| 94 | 109 | ||
| 95 | 110 | # Binary Tests |
|
| 96 | 111 | ||
| 97 | 112 | # Only tests with `//! returns:` are compiled to binaries and executed. |
|
| 98 | - | BIN_TEST_SRC := $(shell grep -l '^//! returns:' \ |
|
| 99 | - | $(wildcard test/tests/*.rad test/tests/*.ras)) |
|
| 100 | - | BIN_TEST_BIN := $(addsuffix .rv64,$(basename $(BIN_TEST_SRC))) |
|
| 113 | + | BIN_TEST_SRC := $(shell grep -l '^//! returns:' $(wildcard test/tests/*.rad test/tests/*.ras)) |
|
| 114 | + | BIN_TEST_BIN := $(addsuffix .rv64,$(basename $(BIN_TEST_SRC))) |
|
| 115 | + | FIXTURE_INPUTS := $(wildcard test/tests/*.ras test/tests/*/*.rad) |
|
| 101 | 116 | ||
| 102 | 117 | bin-test: test/runner.rv64 $(INTEGRATION) $(BIN_TEST_BIN) |
|
| 103 | 118 | @$(call integration,bin) |
|
| 104 | 119 | ||
| 105 | 120 | # A `.rad` executable test can have a same-basename `.ras` module. |
|
| 106 | 121 | # Compile each executable test to a binary. A test with `//! uses-std` links |
|
| 107 | 122 | # the standard library. Child modules and assembly inputs are dependencies. |
|
| 108 | 123 | # Fixtures that use std must rebuild when a library source changes. |
|
| 109 | 124 | # The compiler depends on the standard library source manifest and its modules. |
|
| 110 | - | test/tests/%.rv64: test/tests/%.rad $(RAD_BIN) $(INTEGRATION) test/Makefile |
|
| 125 | + | test/tests/%.rv64: test/tests/%.rad $(FIXTURE_INPUTS) $(RAD_BIN) $(INTEGRATION) test/Makefile |
|
| 111 | 126 | @$(call integration,compile,$< $@) |
|
| 112 | 127 | ||
| 113 | 128 | test/tests/%.rv64: test/tests/%.ras test/runner.rv64 test/Makefile |
|
| 114 | 129 | @$(HOSTED) test/runner.rv64 assemble $< $@ |
|
| 115 | 130 | ||
| 116 | - | # Multi-file fixture inputs. |
|
| 117 | - | test/tests/asm.link.rv64: test/tests/asm.link.ras |
|
| 118 | - | test/tests/asm.rodata.prefix.rv64: test/tests/asm.rodata.prefix.ras |
|
| 119 | - | test/tests/assign.qualified.static.rv64: \ |
|
| 120 | - | test/tests/assign.qualified.static/storage.rad |
|
| 121 | - | test/tests/entry.storage.start.rv64: test/tests/entry.storage.start.start.ras |
|
| 122 | - | test/tests/fn.unsafe.callbacks.rv64: \ |
|
| 123 | - | test/tests/fn.unsafe.callbacks/operations.rad |
|
| 124 | - | test/tests/method.module.rv64: test/tests/method.module/counter.rad |
|
| 125 | - | test/tests/optional.union.const.match.rv64: \ |
|
| 126 | - | test/tests/optional.union.const.match/consts.rad |
|
| 127 | - | test/tests/record.opaque.rv64: test/tests/record.opaque/model.rad |
|
| 128 | - | test/tests/ref.qualified.static.rv64: \ |
|
| 129 | - | test/tests/ref.qualified.static/storage.rad |
|
| 130 | - | test/tests/return.never.rv64: test/tests/return.never.ras |
|
| 131 | - | test/tests/stack.limit.ok.rv64: test/tests/stack.limit.ok.start.ras |
|
| 132 | - | test/tests/stack.limit.trap.rv64: test/tests/stack.limit.trap.start.ras |
|
| 133 | - | test/tests/start.default.rv64: test/tests/start.default.start.ras |
|
| 134 | - | test/tests/start.exit.rv64: test/tests/start.exit.start.ras |
|
| 135 | - | test/tests/wildcard.import.owner.rv64: \ |
|
| 136 | - | test/tests/wildcard.import.owner/wildcard_import_owner.rad |
|
| 137 | - | ||
| 138 | 131 | clean-bin-test: |
|
| 139 | 132 | @rm -f $(TEST_TOOLS) $(INTEGRATION) $(BIN_TEST_BIN) \ |
|
| 140 | 133 | test/compiler/discovery.rv64 \ |
|
| 141 | 134 | $(wildcard test/tests/*.rv64.debug test/tests/*.rv64.s) \ |
|
| 142 | 135 | $(TEST_TOOLS:.rv64=.rv64.debug) $(TEST_TOOLS:.rv64=.rv64.s) \ |
| 222 | 215 | # Exercise the production test discovery module with bounded storage. |
|
| 223 | 216 | test/compiler/discovery.rv64: test/compiler/discovery.rad \ |
|
| 224 | 217 | compiler/radiance/testgen.rad $(STD_LIB) $(RAD_BIN) test/Makefile |
|
| 225 | 218 | @$(RADIANCE) $(STD) -pkg testgen -mod compiler/radiance/testgen.rad \ |
|
| 226 | 219 | -pkg checks -mod test/compiler/discovery.rad -entry checks -o $@ |
|
| 220 | + | ||
| 221 | + | .PHONY: test $(TESTS) $(SMP_TESTS) $(CYCLES_TESTS) clean-std-test clean-bin-test |