diff --git a/runtestsbetterc.sh b/runtestsbetterc.sh new file mode 100755 index 0000000..04d5f6f --- /dev/null +++ b/runtestsbetterc.sh @@ -0,0 +1,2 @@ +#!/usr/bin/env sh +dmd -unittest -debug -g -betterC -I=source -i -run testsbetterc/* diff --git a/testsbetterc/inlineimport.d b/testsbetterc/inlineimport.d new file mode 100644 index 0000000..2fd5a88 --- /dev/null +++ b/testsbetterc/inlineimport.d @@ -0,0 +1,17 @@ +module testsbetterc.enumify; + +version(D_BetterC) {} else static assert(false, "Must compile with -betterC"); +version(unittest) {} else static assert(false, "Must compile with -unittest"); + +extern(C) int main() { + import core.stdc.stdio : puts, printf; + import taurus.inlineimport; + + static foreach (test; __traits(getUnitTests, __traits(parent, from))) { + printf("Running %.*s\n", cast(int) test.stringof.length, test.stringof.ptr); + test(); + } + + puts("Tests ran successfully."); + return 0; +}