diff options
author | don bright <hugh.m.bright@gmail.com> | 2013-02-03 00:39:43 (GMT) |
---|---|---|
committer | don bright <hugh.m.bright@gmail.com> | 2013-02-03 00:39:43 (GMT) |
commit | b390d54471201731db1158fa21aa54fcef1f7582 (patch) | |
tree | 87bd600de213e8aa3e3b0dfcb0b9c4da1a02d1da | |
parent | 8c9c9adfe0f0fa5c1ade561a61f3f8add3600c22 (diff) |
fix bug in test_pretty_print.cc / Cmakefile
The build needs to be after Python binary has been found because the Python
binary path is passed to the .cc compile through a -D flag.
-rw-r--r-- | tests/CMakeLists.txt | 18 | ||||
-rw-r--r-- | tests/test_pretty_print.cc | 4 | ||||
-rwxr-xr-x | tests/virtualfb.sh | 2 |
3 files changed, 13 insertions, 11 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 854fb44..611cb5f 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -569,15 +569,6 @@ set_target_properties(throwntogethertest PROPERTIES COMPILE_FLAGS "-DENABLE_OPEN target_link_libraries(throwntogethertest tests-offscreen tests-cgal ${OPENCSG_LIBRARY} ${TESTS-CGAL-LIBRARIES} ${GLEW_LIBRARY} ${COCOA_LIBRARY}) # -# Post-test pretty print -# - -add_executable(test_pretty_print test_pretty_print.cc) -set_target_properties(test_pretty_print PROPERTIES COMPILE_FLAGS - "-DPYBIN=${PYTHON_EXECUTABLE} -DPYSRC=test_pretty_print.py -DBUILDDIR=--builddir=${CMAKE_CURRENT_BINARY_DIR}" -) - -# # Tags tests as disabled. This is more convenient than removing them manually # from the lists of filenames # @@ -800,6 +791,15 @@ endif() # 1. Start/stop Virtual Framebuffer for linux/bsd. 2. Pretty Print # Please see the CTestCustom.template file for more info. +# +# Post-test pretty print +# + +add_executable(test_pretty_print test_pretty_print.cc) +set_target_properties(test_pretty_print PROPERTIES COMPILE_FLAGS + "-DPYBIN=${PYTHON_EXECUTABLE} -DPYSRC=test_pretty_print.py -DBUILDDIR=--builddir=${CMAKE_CURRENT_BINARY_DIR}" +) + file(READ ${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.template TMP) string(REPLACE __cmake_current_binary_dir__ ${CMAKE_CURRENT_BINARY_DIR} TMP ${TMP}) string(REPLACE __cmake_current_source_dir__ ${CMAKE_CURRENT_SOURCE_DIR} TMP ${TMP}) diff --git a/tests/test_pretty_print.cc b/tests/test_pretty_print.cc index b400e21..9959189 100644 --- a/tests/test_pretty_print.cc +++ b/tests/test_pretty_print.cc @@ -1,11 +1,12 @@ /* Workaround for CTEST_CUSTOM_POST_TEST not allowing arguments compile with - -DPYBIN=/usr/bin/python + -DPYBIN=/usr/bin/python -DPYSRC=/home/janedoe/openscad/tests/test_pretty_print.py -DBUILDDIR=--builddir=/home/janedoe/openscad/tests/bin" */ #include <unistd.h> +//#include <stdio.h> #define PREQUOTE(x) #x #define QUOTE(x) PREQUOTE(x) @@ -16,6 +17,7 @@ int main( int argc, char * argv[] ) newargs[1] = const_cast<char *>(QUOTE( PYSRC )); newargs[2] = const_cast<char *>(QUOTE( BUILDDIR )); newargs[3] = NULL; + //printf(":%s:%s:%s\n", newargs[0], newargs[1], newargs[2]); return execv( newargs[0], newargs ); } diff --git a/tests/virtualfb.sh b/tests/virtualfb.sh index d34a4f9..5abd804 100755 --- a/tests/virtualfb.sh +++ b/tests/virtualfb.sh @@ -34,7 +34,7 @@ stop() VFB_PID=`cat ./virtualfb.PID` VFB_DISPLAY=`cat ./virtualfb.DISPLAY` - echo "Stopping virtual fb, PID=$VFB_PID, DISPLAY=$VFB_DISPLAY" + echo "Stopping virtual fb, PID was $VFB_PID, DISPLAY was $VFB_DISPLAY" kill $VFB_PID LOCKFILE=`echo "/tmp/.X"$VFB_DISPLAY"-lock"` if [ -e $LOCKFILE ]; then |