@@ -427,14 +427,42 @@ unittest/%.run : $(ROOT)/unittest/test_runner
427427# Run separate -betterC tests
428428# ###############################################################################
429429
430- test/betterC/% .run : test/betterC/% .d $(DMD ) $(LIB )
430+ test/betterC/% .run : test/betterC/% .d $(DMD ) $(DRUNTIME )
431431 mkdir -p $(ROOT ) /unittest/betterC
432432 $(DMD ) $(DFLAGS ) -of$(ROOT ) /unittest/betterC/$(notdir $(basename $< ) ) -betterC $(UDFLAGS ) \
433433 -defaultlib= -debuglib= $(LINKDL ) $<
434434 ./$(ROOT ) /unittest/betterC/$(notdir $(basename $< ) )
435435
436436betterC : $(subst .d,.run,$(wildcard test/betterC/* .d) )
437437
438+ # ###############################################################################
439+ # Run separate baremetal tests (for now only on x86_32 and x86_64 Linux)
440+ # ###############################################################################
441+
442+ MINIMAL_RUNTIME =$(ROOT ) /unittest/baremetal/runtime.a
443+
444+ $(MINIMAL_RUNTIME ) : test/baremetal/runtime/runtime.d $(DMD ) $(DRUNTIME )
445+ mkdir -p $(ROOT ) /unittest/baremetal
446+ $(DMD ) -betterC -c $(DFLAGS ) -lib -of$@ $<
447+
448+ test/baremetal/% .run : test/baremetal/% .d $(DMD ) $(MINIMAL_RUNTIME )
449+ mkdir -p $(ROOT ) /unittest/baremetal
450+ $(DMD ) $(DFLAGS ) -c -betterC -of$(ROOT ) /unittest/baremetal/$(notdir $(basename $< ) ) .o -betterC $(UDFLAGS ) $<
451+ ld $(ROOT ) /unittest/baremetal/$(notdir $(basename $< ) ) .o $(MINIMAL_RUNTIME ) \
452+ -o $(ROOT ) /unittest/baremetal/$(notdir $(basename $< ) )
453+ ./$(ROOT ) /unittest/baremetal/$(notdir $(basename $< ) )
454+
455+ ifneq (linux, $(OS ) )
456+ baremetal :
457+ @echo " Baremetal tests are currently only run on Linux x86_32 and x86_64"
458+ else
459+ ifeq (,$(findstring $(MODEL ) ,32 64) )
460+ baremetal :
461+ @echo " Baremetal tests are currently only run on Linux x86_32 and x86_64"
462+ endif
463+ baremetal : $(subst .d,.run,$(wildcard test/baremetal/* .d) )
464+ endif
465+
438466# ###############################################################################
439467# More stuff
440468# ###############################################################################
@@ -634,6 +662,6 @@ $(TESTS_EXTRACTOR): $(TOOLS_DIR)/tests_extractor.d | $(LIB)
634662auto-tester-build : all checkwhitespace
635663
636664.PHONY : auto-tester-test
637- auto-tester-test : unittest betterC
665+ auto-tester-test : unittest betterC baremetal
638666
639667.DELETE_ON_ERROR : # GNU Make directive (delete output files on error)
0 commit comments