Skip to content

Commit 38c755a

Browse files
committed
fix(test): Move the testsuite out of tree
To ensure its compilation is opt-in and not opt-out. This also moves the integration test suite to offer better segmentation.
1 parent 49ee86d commit 38c755a

File tree

885 files changed

+57
-52
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

885 files changed

+57
-52
lines changed

.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
*.a
44
*.o
55
.dub/
6-
test/*/.dub/
6+
test/integration/*/.dub/

.github/workflows/main.yml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ jobs:
115115
run: |
116116
dub build --compiler=${{ env.DC }}
117117
if [[ ${{ matrix.do_test }} == 'true' ]]; then
118-
dub run --compiler=${{ env.DC }} --single test/issue2051_running_unittests_from_dub_single_file_packages_fails.d
118+
dub run --compiler=${{ env.DC }} --single test/integration/issue2051_running_unittests_from_dub_single_file_packages_fails.d
119119
./scripts/ci/ci.sh
120120
fi
121121
@@ -127,19 +127,19 @@ jobs:
127127
dub build --compiler=${{ env.DC }}
128128
if [[ ${{ matrix.do_test }} == 'true' ]]; then
129129
dub test --compiler=${{ env.DC }}
130-
dub run --compiler=${{ env.DC }} --single test/issue2051_running_unittests_from_dub_single_file_packages_fails.d
131-
dub --single test/run-unittest.d
130+
dub run --compiler=${{ env.DC }} --single test/integration/issue2051_running_unittests_from_dub_single_file_packages_fails.d
131+
dub --single test/integration/run-test.d
132132
133133
# FIXME: DMD fails a few tests on Windows; remove them for now
134134
if [[ '${{ matrix.dc }}' = dmd* ]]; then
135135
# DLL support is lacking
136-
rm -rf test/{1-dynLib-simple,2-dynLib-dep,2-dynLib-with-staticLib-dep}
136+
rm -rf test/integration/{1-dynLib-simple,2-dynLib-dep,2-dynLib-with-staticLib-dep}
137137
# Unicode in paths too
138-
rm -rf test/issue130-unicode-СНА*
138+
rm -rf test/integration/issue130-unicode-СНА*
139139
# ImportC probably requires set-up MSVC environment variables
140-
rm -rf test/use-c-sources
140+
rm -rf test/integration/use-c-sources
141141
fi
142-
test/run-unittest.sh
142+
test/integration/run-test.sh
143143
fi
144144
shell: bash
145145

.gitignore

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -35,20 +35,20 @@ __dummy.html
3535
*.exe
3636
*.lib
3737
*.log
38-
/test/*/*
39-
/test/*.*
40-
!/test/*.d
41-
!/test/*.d.min_frontend
42-
!/test/*.sh
43-
!/test/*.sh.min_frontend
44-
!/test/*/.no_*
45-
!/test/*/.min_frontend
46-
!/test/*/.fail_build
47-
!/test/*/dub.json
48-
!/test/*/dub.sdl
49-
!/test/*/dub.settings.json
50-
!/test/*/source/
51-
!/test/*/src/
38+
/test/integration/*/*
39+
/test/integration/*.*
40+
!/test/integration/*.d
41+
!/test/integration/*.d.min_frontend
42+
!/test/integration/*.sh
43+
!/test/integration/*.sh.min_frontend
44+
!/test/integration/*/.no_*
45+
!/test/integration/*/.min_frontend
46+
!/test/integration/*/.fail_build
47+
!/test/integration/*/dub.json
48+
!/test/integration/*/dub.sdl
49+
!/test/integration/*/dub.settings.json
50+
!/test/integration/*/source/
51+
!/test/integration/*/src/
5252

5353
# Ignore coverage files
5454
cov/

docker/Dockerfile.alpine

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ RUN dub test --compiler=$DCBIN && dub build --compiler=$DCBIN
1414
# Remove dub to avoid the risk of using the wrong binary
1515
RUN apk del dub
1616

17-
# Used by the `run-unittest.sh` script
17+
# Used by the `run-test.sh` script
1818
ENV DUB=/root/build/bin/dub
1919
ENV DC=$DCBIN
2020

2121
# Finally, just run the test-suite
22-
WORKDIR /root/build/test/
23-
ENTRYPOINT [ "/root/build/test/run-unittest.sh" ]
22+
WORKDIR /root/build/test/integration/
23+
ENTRYPOINT [ "/root/build/test/integration/run-test.sh" ]

dub.sdl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ configuration "application" {
2424
//dflags "-fpreview=in" platform="gdc"
2525
}
2626

27+
configuration "unittest" {
28+
versions "DubUseCurl"
29+
sourcePaths "source" "test/unit/"
30+
}
31+
2732
configuration "library" {
2833
targetType "library"
2934
excludedSourceFiles "source/app.d"

scripts/ci/ci.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ else
1818
dub test --compiler=${DC} -b unittest-cov
1919
./build.d
2020
fi
21-
DUB=`pwd`/bin/dub DC=${DC} dub --single ./test/run-unittest.d
22-
DUB=`pwd`/bin/dub DC=${DC} test/run-unittest.sh
21+
DUB=`pwd`/bin/dub DC=${DC} dub --single ./test/integration/run-test.d
22+
DUB=`pwd`/bin/dub DC=${DC} test/integration/run-test.sh

test/dub-custom-root-2/source/app.d

Lines changed: 0 additions & 12 deletions
This file was deleted.

test/dub-custom-root/source/app.d

Lines changed: 0 additions & 10 deletions
This file was deleted.

test/.gitignore renamed to test/integration/.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ version-spec/**/foo
1818

1919
/test_registry
2020
/issue_2051_running_unittests_from_dub_single_file_packages_fails
21-
/run-unittest
21+
/run-test
2222

2323
test.log
2424
custom-source-main-bug487/custom-source-main-bug487
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import std.file;
2+
import std.path;
3+
import std.stdio;
4+
import std.string;
5+
6+
void main()
7+
{
8+
// run me from test/integration/ with dub --root=dub-custom-root
9+
string cwd = getcwd.chomp("/");
10+
assert(cwd.endsWith("test/integration/dub-custom-root-2/source"), cwd);
11+
writeln("ok");
12+
}
File renamed without changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import std.file;
2+
import std.path;
3+
import std.stdio;
4+
5+
void main()
6+
{
7+
// run me from test/integration/ with dub --root=test/integration/dub-custom-root
8+
assert(getcwd.baseName == "integration", getcwd);
9+
writeln("ok");
10+
}
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)