summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarius Kintel <marius@kintel.net>2013-12-09 05:48:26 (GMT)
committerMarius Kintel <marius@kintel.net>2013-12-09 05:48:26 (GMT)
commit7e0917d6b22fe8225fff7c66d352145d669a4a5d (patch)
tree10923429ee676f33cc5dd7438500c4a81676fe78
parent3bd224b990f6d6b4c51072bf0c3ae895fbfe707e (diff)
parente96305ddf5a728eb323a86e4e900752ae2a6ccfe (diff)
Merge branch 'travis'
-rw-r--r--.travis.yml9
-rwxr-xr-xscripts/travis-ci.sh5
-rw-r--r--tests/CMakeLists.txt6
-rw-r--r--tests/CTestCustom.template7
-rwxr-xr-xtests/test_pretty_print.py5
5 files changed, 23 insertions, 9 deletions
diff --git a/.travis.yml b/.travis.yml
index 9442ca4..c499a8d 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,14 +1,17 @@
language: cpp
-compiler:
- - gcc
+cache: apt
+compiler: gcc
+
before_install:
- echo 'yes' | sudo add-apt-repository ppa:chrysn/openscad
- sudo apt-get update -qq
- sudo apt-get install -qq build-essential libqt4-dev libqt4-opengl-dev libxmu-dev cmake bison flex git-core libboost-all-dev libXi-dev libmpfr-dev libboost-dev libglew-dev libeigen2-dev libeigen3-dev libcgal-dev libgmp3-dev libgmp-dev python-paramiko curl imagemagick
- sudo apt-get install -qq libopencsg-dev
+env: OPENSCAD_UPLOAD_TESTS=yes
+
branches:
only:
- - travis
+ - master
script: ./scripts/travis-ci.sh
diff --git a/scripts/travis-ci.sh b/scripts/travis-ci.sh
index 9d4258a..9f44b0c 100755
--- a/scripts/travis-ci.sh
+++ b/scripts/travis-ci.sh
@@ -1,10 +1,5 @@
#!/bin/bash
-qmake && make -j4
-if [[ $? != 0 ]]; then
- echo "Error building OpenSCAD executable"
- exit 1
-fi
cd tests
cmake .
if [[ $? != 0 ]]; then
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index f92eddf..779ef08 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -904,6 +904,12 @@ string(REPLACE __header__ "Generated by cmake from ${CMAKE_CURRENT_SOURCE_DIR}/C
string(REPLACE __cmake_system_name__ ${CMAKE_SYSTEM_NAME} TMP ${TMP})
string(REPLACE __openscad_binpath__ ${OPENSCAD_BINPATH} TMP ${TMP})
+set(OPENSCAD_UPLOAD_TESTS $ENV{OPENSCAD_UPLOAD_TESTS})
+if (OPENSCAD_UPLOAD_TESTS)
+ set(UPLOADARG "--upload")
+endif()
+string(REPLACE __openscad_upload_tests__ ${UPLOADARG} TMP ${TMP})
+
if (MINGW_CROSS_ENV_DIR)
string(REPLACE __wine__ wine TMP ${TMP})
else()
diff --git a/tests/CTestCustom.template b/tests/CTestCustom.template
index 3f82d73..a01f2b5 100644
--- a/tests/CTestCustom.template
+++ b/tests/CTestCustom.template
@@ -63,7 +63,12 @@ endif()
message("running '__openscad_binpath__ --info' to generate sysinfo.txt")
execute_process(COMMAND __wine__ __openscad_binpath__ --info OUTPUT_FILE sysinfo.txt)
-set(CTEST_CUSTOM_POST_TEST ${CTEST_CUSTOM_POST_TEST} "__cmake_current_binary_dir__/test_pretty_print")
+
+if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_LESS 2.8.12)
+ set(CTEST_CUSTOM_POST_TEST ${CTEST_CUSTOM_POST_TEST} "__cmake_current_binary_dir__/test_pretty_print")
+else()
+ set(CTEST_CUSTOM_POST_TEST ${CTEST_CUSTOM_POST_TEST} "__python__ __cmake_current_source_dir__/test_pretty_print.py --builddir=__cmake_current_binary_dir__ __openscad_upload_tests__")
+endif()
if ( ${debug_openscad_template} )
foreach(post_test ${CTEST_CUSTOM_POST_TEST} )
diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py
index c0d35bb..0f86cb6 100755
--- a/tests/test_pretty_print.py
+++ b/tests/test_pretty_print.py
@@ -431,6 +431,11 @@ def main():
if '--upload' in sys.argv:
upload = True
debug('will upload test report')
+
+ # Workaround for old cmake's not being able to pass parameters
+ # to CTEST_CUSTOM_POST_TEST
+ if bool(os.getenv("OPENSCAD_UPLOAD_TESTS")):
+ upload = True
# --- End Command Line Parsing ---
contact: Jan Huwald // Impressum