Skip to content

Commit ad671e5

Browse files
committed
travis-ci: Use unit-threaded on configurations that support it.
1 parent 531ac6a commit ad671e5

File tree

5 files changed

+41
-33
lines changed

5 files changed

+41
-33
lines changed

.travis.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,11 @@ matrix:
1414
- d: dmd-2.080.0
1515
env: DUB_SELECT=vibe-0.8.3 # DMDFE 2.079+ doesn't support vibe.d v0.7.32
1616
- d: dmd-2.079.1
17-
env: DUB_SELECT=vibe-0.8.3 # DMDFE 2.079+ doesn't support vibe.d v0.7.32
17+
env: USE_UNIT_THREADED=true DUB_SELECT=vibe-0.8.3
1818
- d: dmd-2.078.3
19+
env: USE_UNIT_THREADED=true
1920
- d: dmd-2.077.1
21+
env: USE_UNIT_THREADED=true
2022
- d: dmd-2.076.1
2123
- d: dmd-2.075.1
2224
- d: dmd-2.074.1
@@ -29,8 +31,11 @@ matrix:
2931
- d: ldc-1.9.0
3032
env: DUB_SELECT=vibe-0.8.3 # DMDFE 2.079+ doesn't support vibe.d v0.7.32
3133
- d: ldc-1.8.0
34+
env: USE_UNIT_THREADED=true
3235
- d: ldc-1.7.0
36+
env: USE_UNIT_THREADED=true
3337
- d: ldc-1.6.0
38+
env: USE_UNIT_THREADED=true
3439
- d: ldc-1.5.0
3540
- d: ldc-1.4.0
3641
- d: ldc-1.3.0
@@ -46,41 +51,41 @@ matrix:
4651
env: DUB_SELECT=vibe-0.8.3 # DMDFE 2.079+ doesn't support vibe.d v0.7.32
4752

4853
# Test alternative db versions, but only on one compiler version
49-
- d: dmd-2.070.2
54+
- d: dmd-2.078.3
5055
services:
5156
- mysql
5257
addons: # Remove "mariadb: ..." from default addons, but keep "libevent-dev"
5358
apt:
5459
packages: [ libevent-dev ]
55-
env: DB=mysql-default
60+
env: DB=mysql-default USE_UNIT_THREADED=true
5661

57-
- d: dmd-2.070.2
62+
- d: dmd-2.078.3
5863
addons:
5964
mariadb: '5.5'
6065
apt:
6166
packages: [ libevent-dev ]
62-
env: DB=mariadb-5.5
67+
env: DB=mariadb-5.5 USE_UNIT_THREADED=true
6368

6469
- d: dmd-2.078.3
6570
addons:
6671
mariadb: '10.0'
6772
apt:
6873
packages: [ libevent-dev ]
69-
env: DB=mariadb-10.0
74+
env: DB=mariadb-10.0 USE_UNIT_THREADED=true
7075

7176
- d: dmd-2.078.3
7277
addons:
7378
mariadb: '10.2'
7479
apt:
7580
packages: [ libevent-dev ]
76-
env: DB=mariadb-10.2
81+
env: DB=mariadb-10.2 USE_UNIT_THREADED=true
7782

7883
- d: dmd-2.078.3
7984
addons:
8085
mariadb: '10.3'
8186
apt:
8287
packages: [ libevent-dev ]
83-
env: DB=mariadb-10.3
88+
env: DB=mariadb-10.3 USE_UNIT_THREADED=true
8489

8590
# on Mac just test latest & oldest supported dmd and ldc
8691
- d: dmd-2.080.0

run-phobos-tests

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,23 @@ else
1717
DEBUG_TESTS_ID=MYSQLN_TESTS
1818
fi
1919

20+
if [ "$USE_UNIT_THREADED" = "true" ]; then
21+
MSG_SUFFIX="$MSG_SUFFIX (unit-threaded)"
22+
UT_VER=0.7.45
23+
UT_SUFFIX='-ut'
24+
UT_ARGS=-version=MYSQLN_TESTS_NO_MAIN -version=Have_unit_threaded -Iunit-threaded-${UT_VER}/unit-threaded/source/ --extra-file=unit-threaded-${UT_VER}/unit-threaded/libunit-threaded.a --exclude=unit_threaded
25+
D_FILE=bin/ut.d
26+
27+
# Setup unit-threaded
28+
dub fetch unit-threaded --version=${UT_VER} --cache=local
29+
cd unit-threaded-${UT_VER}/unit-threaded
30+
dub build -c gen_ut_main
31+
dub build -c library
32+
cd ../..
33+
unit-threaded-${UT_VER}/unit-threaded/gen_ut_main -f bin/ut.d
34+
else
35+
D_FILE=source/mysql/package.d
36+
fi
37+
2038
echo Compiling Phobos-socket tests${MSG_SUFFIX}...
21-
$RDMD --compiler=$DMD --build-only -g -unittest -debug=$DEBUG_TESTS_ID -ofbin/mysqln-tests-phobos -Isource source/mysql/package.d && echo Running Phobos-socket tests${MSG_SUFFIX}... && bin/mysqln-tests-phobos
39+
$RDMD --compiler=$DMD --build-only -g -unittest $UT_ARGS -debug=$DEBUG_TESTS_ID -ofbin/mysqln-tests-phobos${UT_SUFFIX} -Isource $D_FILE && echo Running Phobos-socket tests${MSG_SUFFIX}... && bin/mysqln-tests-phobos${UT_SUFFIX} "$@"

run-phobos-tests-ut

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,4 @@
11
#!/bin/sh
22

3-
. ./find-rdmd.sh
4-
5-
echo Using:
6-
echo " RDMD=$RDMD"
7-
echo " DMD=$DMD"
8-
9-
# GDC doesn't autocreate the dir (and git doesn't beleive in empty dirs)
10-
mkdir -p bin
11-
12-
# Setup unit-threaded
13-
dub fetch unit-threaded --version=0.7.45 --cache=local
14-
cd unit-threaded-0.7.45/unit-threaded
15-
dub build -c gen_ut_main
16-
dub build -c library
17-
cd ../..
18-
unit-threaded-0.7.45/unit-threaded/gen_ut_main -f bin/ut.d
19-
20-
echo Compiling Phobos-socket tests...
21-
$RDMD --compiler=$DMD --build-only -g -unittest -debug=MYSQLN_TESTS -version=MYSQLN_TESTS_NO_MAIN -version=Have_unit_threaded -ofbin/mysqln-tests-phobos-ut -Isource -Iunit-threaded-0.7.37/unit-threaded/source/ --extra-file=unit-threaded-0.7.37/unit-threaded/libunit-threaded.a --exclude=unit_threaded bin/ut.d && echo Running Phobos-socket tests... && bin/mysqln-tests-phobos-ut -t "$@"
3+
export USE_UNIT_THREADED=true
4+
./run-phobos-tests "$@"

run-vibe-tests

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,8 @@
33
# GDC doesn't autocreate the dir (and git doesn't beleive in empty dirs)
44
mkdir -p bin
55

6-
dub test -c unittest-vibe
6+
if [ "$USE_UNIT_THREADED" = "true" ]; then
7+
dub run -c unittest-vibe-ut -- "$@"
8+
else
9+
dub test -c unittest-vibe
10+
fi

run-vibe-tests-ut

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
#!/bin/sh
22

3-
# GDC doesn't autocreate the dir (and git doesn't beleive in empty dirs)
4-
mkdir -p bin
5-
6-
dub run -c unittest-vibe-ut -- -t "$@"
3+
export USE_UNIT_THREADED=true
4+
./run-vibe-tests "$@"

0 commit comments

Comments
 (0)