Skip to content

Commit fb8a0d8

Browse files
committed
build and test python module on travis
1 parent 5d18550 commit fb8a0d8

File tree

5 files changed

+18
-29
lines changed

5 files changed

+18
-29
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ python/docs/_generate
88
*.cobs_cache
99
*.cobs_classic
1010
*.cobs_compact
11+
__pycache__

.travis.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3,24 +3,22 @@
33
language: cpp
44

55
sudo: false
6-
dist: trusty
6+
dist: bionic
7+
8+
addons:
9+
apt:
10+
packages:
11+
- python3
12+
- python3-pip
13+
- python3-setuptools
714

815
matrix:
916
include:
1017
# gcc 7.x, Debug with -O1
11-
- env: CMAKE_CC="gcc-7" CMAKE_CXX="g++-7" BUILD_TYPE="Debug" COMPILER_FLAGS="-O1"
12-
os: linux
13-
addons: &gcc7
14-
apt:
15-
sources:
16-
- ubuntu-toolchain-r-test
17-
packages:
18-
- g++-7
18+
- env: CMAKE_CC="gcc" CMAKE_CXX="g++" BUILD_TYPE="Debug" COMPILER_FLAGS="-O1"
1919

2020
# gcc 7.x, Release
21-
- env: CMAKE_CC="gcc-7" CMAKE_CXX="g++-7" BUILD_TYPE="Release" COMPILER_FLAGS=""
22-
os: linux
23-
addons: *gcc7
21+
- env: CMAKE_CC="gcc" CMAKE_CXX="g++" BUILD_TYPE="Release" COMPILER_FLAGS=""
2422

2523
before_script:
2624

@@ -37,4 +35,8 @@ before_script:
3735
$CMAKE_ARGS ..
3836

3937
script:
40-
- make -j2 && ctest -V
38+
#- make -j2 && ctest -V
39+
# install and test python module
40+
- cd .. && rm -rf build
41+
- pip3 install --user --verbose .
42+
- cd python && python3 -m unittest

python/test.py

Lines changed: 0 additions & 14 deletions
This file was deleted.
File renamed without changes.

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,11 +53,11 @@ def build_extension(self, ext):
5353
if not os.path.exists(self.build_temp):
5454
os.makedirs(self.build_temp)
5555
subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
56-
subprocess.check_call(['cmake', '--build', '.'] + build_args, cwd=self.build_temp)
56+
subprocess.check_call(['cmake', '--build', '.', '--target', 'cobs_python'] + build_args, cwd=self.build_temp)
5757

5858
def test_suite():
5959
test_loader = unittest.TestLoader()
60-
test_suite = test_loader.discover('python/tests', pattern='*_test.py')
60+
test_suite = test_loader.discover('python/tests', pattern='test_*.py')
6161
return test_suite
6262

6363
if __name__ == '__main__':

0 commit comments

Comments
 (0)