Skip to content

Commit 4d31471

Browse files
committed
Add the Phobos v3 unit tests to the regular unittest build.
I'm sure that we'll need to rework the build stuff at some point here (both for Phobos v2 and v3), but this gets the v3 tests run by the v2 Makefile so that the CI will build and run them.
1 parent 2852e84 commit 4d31471

File tree

2 files changed

+18
-8
lines changed

2 files changed

+18
-8
lines changed

Makefile

+1
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,7 @@ else
337337
unittest : unittest-debug unittest-release
338338
unittest-%:
339339
$(MAKE) unittest OS=$(OS) MODEL=$(MODEL) DMD=$(DMD) BUILD=$*
340+
dmd -run build_v3.d unittest-$*
340341
endif
341342

342343
################################################################################

build_v3.d

+17-8
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@ int main(string[] args)
2222
bool buildRelease = false;
2323
if (args.length > 1)
2424
{
25-
buildUnittest = args[1] == "unittest";
26-
buildRelease = args[1] == "release";
25+
switch(args[1])
26+
{
27+
// FIXME unittest should build both debug and release, but that
28+
// requires more extensive changes.
29+
case "unittest": buildUnittest = true; break;
30+
case "unittest-debug": buildUnittest = true; break;
31+
case "unittest-release": buildUnittest = true; goto case "release";
32+
case "release": buildRelease = true; break;
33+
default: break;
34+
}
2735
}
2836

2937
string argFilePath = buildNormalizedPath(getcwd(), "phobosbuildargs.txt");
@@ -69,7 +77,6 @@ int main(string[] args)
6977
{
7078
argFile.writeln("-main");
7179
argFile.writeln("-unittest");
72-
argFile.writeln("-debug");
7380

7481
version(Windows)
7582
{
@@ -80,17 +87,19 @@ int main(string[] args)
8087
argFile.writeln("-of=unittest");
8188
}
8289
}
83-
else if (buildRelease)
90+
else
8491
{
85-
argFile.writeln("-release -O");
8692
argFile.writeln("-lib");
87-
argFile.writeln("-of=libphobos3");
93+
argFile.writefln("-of=libphobos3%s", buildRelease ? "" : "-debug");
94+
}
95+
96+
if (buildRelease)
97+
{
98+
argFile.writeln("-release -O");
8899
}
89100
else
90101
{
91102
argFile.writeln("-debug");
92-
argFile.writeln("-lib");
93-
argFile.writeln("-of=libphobos3-debug");
94103
}
95104

96105
argFile.flush();

0 commit comments

Comments
 (0)