Skip to content

Commit 5657718

Browse files
feat: add unit test bash script
The yml file is updated to build the unit test
1 parent b630df2 commit 5657718

File tree

2 files changed

+48
-4
lines changed

2 files changed

+48
-4
lines changed

.travis.yml

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ os:
1414

1515
env:
1616
global:
17-
- LPIEDITORPATH=source/project/tracker_editor
17+
- LPI_EDITOR_PATH=source/project/tracker_editor
18+
- LPI_UNIT_TEST_PATH=source/project/unit_test
1819
- WINEPREFIX=~/.winelaz
1920
- DISPLAY=:99.0
2021
matrix: #For linux and mac osx build
@@ -26,15 +27,22 @@ matrix: #For windows build with linux wine. Use the same lazarus version as lin
2627
env: LAZ_VER=1.6 LAZ_ENV=wine WINEARCH=win32 LAZ_OPT="--os=win32 --cpu=i386"
2728

2829
before_install:
29-
# Start virtual display server
30+
# Start virtual display server
3031
- sh -e /etc/init.d/xvfb start || true
3132

3233
install:
33-
# Install prerequisites (fpc/lazarus/wine/qemu)
34+
# Install prerequisites (fpc/lazarus/wine/qemu)
3435
- ./travis-lazarus/.travis.install.py
3536

3637
script:
37-
- lazbuild $LAZ_OPT $LPIEDITORPATH/trackereditor.lpi # Build trackereditor project
38+
# Build trackereditor project
39+
- lazbuild $LAZ_OPT $LPI_EDITOR_PATH/trackereditor.lpi
40+
41+
# Build unit test project
42+
- lazbuild $LAZ_OPT $LPI_UNIT_TEST_PATH/tracker_editor_test.lpi
43+
44+
# Start the unit test
45+
- source ./scripts/travis_unit_test.sh
3846

3947
before_deploy:
4048
- source ./scripts/travis_deploy.sh

scripts/travis_unit_test.sh

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#!/bin/bash
2+
3+
#Run unit test in Windows, Linux and macOS
4+
5+
6+
#----------- check for Windows, Linux and macOS build
7+
if [ "$TRAVIS_OS_NAME" = "linux" ]
8+
then
9+
10+
#wine = windows
11+
if [ "$LAZ_ENV" = "wine" ]
12+
then
13+
14+
#windows
15+
enduser/tracker_editor_test.exe -a --format=plain
16+
17+
else
18+
19+
#linux
20+
enduser/tracker_editor_test -a --format=plain
21+
22+
fi
23+
24+
elif [ "$TRAVIS_OS_NAME" = "osx" ]
25+
then
26+
#macOS
27+
cd enduser
28+
29+
#start the unit test
30+
tracker_editor_test -a --format=plain
31+
32+
cd ..
33+
34+
fi
35+
36+
echo "Unit test ready"

0 commit comments

Comments
 (0)