Skip to content

Commit

Permalink
Add -betterC testsuite for Phobos
Browse files Browse the repository at this point in the history
  • Loading branch information
wilzbach committed Jul 20, 2018
1 parent 4211eec commit a951119
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
14 changes: 13 additions & 1 deletion posix.mak
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,18 @@ unittest/%.run : $(ROOT)/unittest/test_runner
%.debug : %.d
BUILD=debug $(MAKE) -f $(MAKEFILE) $(basename $<).debug_with_debugger

################################################################################
# Run separate -betterC tests
################################################################################

test/betterC/%.run: test/betterC/%.d $(DMD) $(LIB)
mkdir -p $(ROOT)/unittest/betterC
$(DMD) $(DFLAGS) -of$(ROOT)/unittest/betterC/$(notdir $(basename $<)) -betterC $(UDFLAGS) \
-defaultlib= -debuglib= $(LINKDL) $<
./$(ROOT)/unittest/betterC/$(notdir $(basename $<))

betterC: $(subst .d,.run,$(wildcard test/betterC/*.d))

################################################################################
# More stuff
################################################################################
Expand Down Expand Up @@ -622,6 +634,6 @@ $(TESTS_EXTRACTOR): $(TOOLS_DIR)/tests_extractor.d | $(LIB)
auto-tester-build: all checkwhitespace

.PHONY : auto-tester-test
auto-tester-test: unittest
auto-tester-test: unittest betterC

.DELETE_ON_ERROR: # GNU Make directive (delete output files on error)
4 changes: 4 additions & 0 deletions test/betterC/algorithm.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
extern(C) void main() {
import std.algorithm, std.range;
assert(100.iota.stride(2).take(10).sum == 90);
}

0 comments on commit a951119

Please sign in to comment.