Skip to content

Commit

Permalink
betterC: add inlineimport test runnable for betterC
Browse files Browse the repository at this point in the history
Signed-off-by: João Lourenço <[email protected]>
  • Loading branch information
iK4tsu committed Jun 13, 2021
1 parent 0480f64 commit 88d01bc
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
2 changes: 2 additions & 0 deletions runtestsbetterc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/usr/bin/env sh
dmd -unittest -debug -g -betterC -I=source -i -run testsbetterc/*
17 changes: 17 additions & 0 deletions testsbetterc/inlineimport.d
Original file line number Diff line number Diff line change
@@ -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;
}

0 comments on commit 88d01bc

Please sign in to comment.