-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[convert test/dynLib-monolith.sh to dynLib-monolith.script.d for Wind…
…ows support]
- Loading branch information
Showing
2 changed files
with
39 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
/+ dub.json: { | ||
"name": "dynlib-monolith-script" | ||
} +/ | ||
module dynlib_monolith_script; | ||
|
||
import std.algorithm, std.path, std.process, std.stdio; | ||
|
||
int main() | ||
{ | ||
const dc = environment.get("DC", "dmd"); | ||
if (!dc.startsWith("ldc")) | ||
{ | ||
writeln("Skipping test, needs LDC"); | ||
return 0; | ||
} | ||
|
||
// enforce a full build (2 static libs, 1 dynamic one) and collect -v output | ||
enum projDir = dirName(__FILE_FULL_PATH__).buildPath("dynLib-monolith"); | ||
const res = execute([environment.get("DUB", "dub"), "build", "-f", "-v", "--root", projDir]); | ||
|
||
int errorOut(string msg) | ||
{ | ||
writeln("Error: " ~ msg); | ||
writeln("==========================================================="); | ||
writeln(res.output); | ||
writeln("==========================================================="); | ||
return 1; | ||
} | ||
|
||
if (res.status != 0) | ||
return errorOut("The dub invocation failed:"); | ||
|
||
version (Windows) enum needle = " -fvisibility=hidden -dllimport=defaultLibsOnly"; | ||
else enum needle = " -fvisibility=hidden"; | ||
if (res.output.count(needle) != 3) | ||
return errorOut("Cannot find exactly 3 occurrences of '" ~ needle ~ "' in the verbose dub output:"); | ||
|
||
return 0; | ||
} |
This file was deleted.
Oops, something went wrong.