Skip to content

Commit ae7b757

Browse files
committed
Add build targets for building rustc as a test runner. Issue #428
1 parent 73e6a4f commit ae7b757

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed

mk/tests.mk

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,3 +366,31 @@ check-stage3-std:test/stdtest.stage3$(X)
366366
@$(call E, run: $<)
367367
$(Q)$(call CFG_RUN_TARG,stage3,stage3, $<)
368368

369+
# Testing the rustctest crate
370+
371+
test/rustctest.stage1$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ0) \
372+
stage0/intrinsics.bc
373+
@$(call E, compile_and_link: $@)
374+
$(STAGE0) -o $@ $< --test
375+
376+
test/rustctest.stage2$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ1) \
377+
stage1/intrinsics.bc
378+
@$(call E, compile_and_link: $@)
379+
$(STAGE1) -o $@ $< --test
380+
381+
test/rustctest.stage3$(X): $(COMPILER_CRATE) $(COMPILER_INPUTS) $(SREQ2) \
382+
stage2/intrinsics.bc
383+
@$(call E, compile_and_link: $@)
384+
$(STAGE2) -o $@ $< --test
385+
386+
check-stage1-rustc: test/rustctest.stage1$(X)
387+
@$(call E, run: $<)
388+
$(Q)$(call CFG_RUN_TARG,stage1,stage0, $<)
389+
390+
check-stage2-rustc: test/rustctest.stage2$(X)
391+
@$(call E, run: $<)
392+
$(Q)$(call CFG_RUN_TARG,stage2,stage1, $<)
393+
394+
check-stage3-rustc: test/rustctest.stage3$(X)
395+
@$(call E, run: $<)
396+
$(Q)$(call CFG_RUN_TARG,stage2,stage1, $<)

0 commit comments

Comments
 (0)