summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt89
-rw-r--r--tests/CTestCustom.template68
-rw-r--r--tests/FindGLEW.cmake92
-rw-r--r--tests/guicgalpngtest.cc8
-rw-r--r--tests/regression/cgalpngtest/import_stl-tests-expected.pngbin5758 -> 10193 bytes
-rw-r--r--tests/regression/cgalpngtest/polygon-intersect-expected.pngbin5170 -> 3012 bytes
-rw-r--r--tests/regression/cgalpngtest/polygon-mesh-expected.pngbin5170 -> 3448 bytes
-rw-r--r--tests/regression/cgalpngtest/polygon-self-intersect-expected.pngbin5170 -> 2918 bytes
-rw-r--r--tests/regression/dumptest/import_stl-tests-expected.txt3
-rw-r--r--tests/regression/opencsgtest/import_stl-tests-expected.pngbin6207 -> 10720 bytes
-rw-r--r--tests/regression/opencsgtest/polygon-intersect-expected.pngbin5170 -> 2901 bytes
-rw-r--r--tests/regression/opencsgtest/polygon-mesh-expected.pngbin5170 -> 4597 bytes
-rw-r--r--tests/regression/opencsgtest/polygon-self-intersect-expected.pngbin5170 -> 2405 bytes
-rw-r--r--tests/regression/throwntogethertest/import_stl-tests-expected.pngbin6207 -> 10720 bytes
-rw-r--r--tests/regression/throwntogethertest/polygon-intersect-expected.pngbin1810 -> 3006 bytes
-rw-r--r--tests/regression/throwntogethertest/polygon-mesh-expected.pngbin1810 -> 4682 bytes
-rw-r--r--tests/regression/throwntogethertest/polygon-self-intersect-expected.pngbin1810 -> 2403 bytes
-rwxr-xr-xtests/test_pretty_print.py17
-rwxr-xr-xtests/virtualfb.sh22
19 files changed, 212 insertions, 87 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index c606d22..d0e5075 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -42,6 +42,11 @@ if(${CMAKE_BUILD_TYPE} STREQUAL "Debug")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DDEBUG")
endif()
+# MCAD
+if(NOT EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../libraries/MCAD/__init__.py)
+ message(FATAL_ERROR "MCAD not found. You can install from the OpenSCAD root as follows: \n git submodule update --init")
+endif()
+
#
# Windows
#
@@ -289,8 +294,7 @@ if (NOT $ENV{GLEWDIR} STREQUAL "")
elseif (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "")
set(GLEW_DIR "$ENV{OPENSCAD_LIBRARIES}")
endif()
-if (NOT GLEW_INCLUDE_DIR)
- message(STATUS "OPENCSG_DIR: " ${OPENCSG_DIR})
+if (GLEW_DIR)
find_path(GLEW_INCLUDE_DIR
GL/glew.h
HINTS ${GLEW_DIR}/include
@@ -299,16 +303,18 @@ if (NOT GLEW_INCLUDE_DIR)
NAMES GLEW glew
HINTS ${GLEW_DIR}/lib ${GLEW_DIR}/lib64
NO_DEFAULT_PATH)
- if (NOT GLEW_LIBRARY)
- find_package(GLEW REQUIRED)
- if (NOT GLEW_LIBRARY)
- message(FATAL_ERROR "GLEW not found")
- endif()
+ if (GLEW_INCLUDE_DIR AND GLEW_LIBRARY)
+ set(GLEW_FOUND 1)
endif()
- message(STATUS "GLEW include: " ${GLEW_INCLUDE_DIR})
- message(STATUS "GLEW library: " ${GLEW_LIBRARY})
endif()
+if (NOT GLEW_FOUND)
+ find_package(GLEW REQUIRED)
+endif()
+
+message(STATUS "GLEW include: " ${GLEW_INCLUDE_DIR})
+message(STATUS "GLEW library: " ${GLEW_LIBRARY})
+
inclusion(GLEW_DIR GLEW_INCLUDE_DIR)
# Flex/Bison
@@ -370,6 +376,19 @@ if (NOT SKIP_IMAGEMAGICK)
endif()
endif()
+if ( "${ImageMagick_VERSION_STRING}" VERSION_LESS "6.5.9.4" )
+ message(STATUS "ImageMagick version less than 6.5.9.4, cannot use -morphology comparison")
+ message(STATUS "ImageMagick Using older image comparison method")
+ set(COMPARATOR "old")
+endif()
+
+execute_process(COMMAND ${ImageMagick_convert_EXECUTABLE} --version OUTPUT_VARIABLE IM_OUT )
+if ( ${IM_OUT} MATCHES "OpenMP" )
+ # http://www.daniloaz.com/en/617/systems/high-cpu-load-when-converting-images-with-imagemagick
+ message(STATUS "ImageMagick: OpenMP bug workaround - setting MAGICK_THREAD_LIMIT=1")
+ set(CTEST_ENVIRONMENT "${CTEST_ENVIRONMENT};MAGICK_THREAD_LIMIT=1")
+endif()
+
# Internal includes
include_directories(../src)
@@ -627,12 +646,6 @@ function(get_test_fullname TESTCMD FILENAME FULLNAME)
set(${FULLNAME} ${${FULLNAME}} PARENT_SCOPE)
endfunction()
-# comparison method to use
-if (NOT $ENV{COMPARATOR} STREQUAL "")
- set(COMPARATOR "$ENV{COMPARATOR}")
- message(STATUS "ImageMagick method modified with COMPARATOR: " ${COMPARATOR})
-endif()
-
#
# This functions adds cmd-line tests given files.
# Files are sent as the parameters following TESTSUFFIX
@@ -667,27 +680,13 @@ macro(add_cmdline_test TESTCMD TESTSUFFIX)
set( MINGW_CROSS_ARG "--mingw-cross-env" )
endif()
add_test(NAME ${TEST_FULLNAME} ${CONFARG} ${CONFVAL} COMMAND ${PYTHON_EXECUTABLE} ${tests_SOURCE_DIR}/test_cmdline_tool.py ${MINGW_CROSS_ARG} --comparator=${COMPARATOR} -c ${ImageMagick_convert_EXECUTABLE} -s ${TESTSUFFIX} ${CMAKE_BINARY_DIR}/${TESTCMD} "${SCADFILE}")
+ set_property(TEST ${TEST_FULLNAME} PROPERTY ENVIRONMENT "${CTEST_ENVIRONMENT}")
endif()
endforeach()
endmacro()
enable_testing()
-# set up custom pretty printing of results
-
-set(INFOCMD "execute_process(COMMAND ${CMAKE_CURRENT_BINARY_DIR}/opencsgtest --info OUTPUT_FILE sysinfo.txt)")
-if (MINGW_CROSS_ENV_DIR)
- set(INFOCMD "execute_process(COMMAND wine ${CMAKE_CURRENT_BINARY_DIR}/opencsgtest --info OUTPUT_FILE sysinfo.txt)")
-endif()
-set(PRETTYCMD "\"${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/test_pretty_print.py --builddir=${CMAKE_CURRENT_BINARY_DIR}\"")
-set(CTEST_CUSTOM_FILE ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake)
-set(CTEST_CUSTOM_TXT "\n
- message(\"running 'opencsgtest --info' to generate sysinfo.txt\")\n
- ${INFOCMD}\n
- set(CTEST_CUSTOM_POST_TEST ${PRETTYCMD})\n
-")
-file(WRITE ${CTEST_CUSTOM_FILE} ${CTEST_CUSTOM_TXT})
-
set_directory_properties(PROPERTIES TEST_INCLUDE_FILE "${CMAKE_SOURCE_DIR}/EnforceConfig.cmake")
# Subst files
@@ -804,6 +803,36 @@ foreach(FILE ${EXAMPLE_FILES})
set_test_config(Examples ${TEST_FULLNAME})
endforeach()
+# Workaround Gallium bugs
+if ( ${CMAKE_SYSTEM_PROCESSOR} MATCHES "ppc")
+ message(STATUS "Workaround PPC bug https://bugs.freedesktop.org/show_bug.cgi?id=42540")
+ set(CTEST_ENVIRONMENT "${CTEST_ENVIRONMENT};GALLIUM_DRIVER=softpipe")
+ set(CTEST_ENVIRONMENT "${CTEST_ENVIRONMENT};DRAW_USE_LLVM=no")
+endif()
+
+# Set up custom commands to run before & after Ctest run.
+# 1. Start/stop Virtual Framebuffer for linux/bsd. 2. Pretty Print
+# Please see the CTestCustom.template file for more info.
+
+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})
+string(REPLACE __python__ ${PYTHON_EXECUTABLE} TMP ${TMP})
+string(REPLACE __header__ "Generated by cmake from ${CMAKE_CURRENT_SOURCE_DIR}/CTestCustom.template" TMP ${TMP})
+string(REPLACE __cmake_system_name__ ${CMAKE_SYSTEM_NAME} TMP ${TMP})
+
+if (MINGW_CROSS_ENV_DIR)
+ string(REPLACE __wine__ wine TMP ${TMP})
+else()
+ string(REPLACE __wine__ " " TMP ${TMP})
+endif()
+
+message(STATUS "creating CTestCustom.cmake")
+file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake ${TMP})
+
+configure_file(${CMAKE_CURRENT_SOURCE_DIR}/test_pretty_print.py
+ ${CMAKE_CURRENT_BINARY_DIR}/test_pretty_print.py COPYONLY)
+
# Add tests
add_cmdline_test(echotest txt ${ECHO_FILES})
diff --git a/tests/CTestCustom.template b/tests/CTestCustom.template
new file mode 100644
index 0000000..72e6443
--- /dev/null
+++ b/tests/CTestCustom.template
@@ -0,0 +1,68 @@
+# __header__
+#
+# This template enables ctest to do things before and after the test runs.
+# In our case, 1. Setup a virtual framebuffer, 2. pretty-print results
+#
+# As a template, this file is read inside of CMakeList.txt and certain
+# words (__word__) are replaced with the cmake build dir/etc, at the time that
+# cmake itself is run. Typically these are signified by two underscores (__)
+# before and after the word in smallcase.
+#
+# The file then becomes CTestCustom.cmake inside the cmake build
+# directory. It is 'run' at the time that ctest is run.
+
+
+# Part 0. X11 and Virtual Framebuffer, for Linux/BSD. This is not used by
+# Windows or Mac because they have alternate means of accessing OpenGL.
+
+set(debug_openscad_template 0)
+
+if( __cmake_system_name__ MATCHES "Linux|BSD")
+ set(DISPLAY_ENV $ENV{DISPLAY})
+ if(DISPLAY_ENV)
+ message("X11 DISPLAY environment variable found. Assuming framebuffer exists at DISPLAY=${DISPLAY_ENV}")
+ else()
+ message("X11 DISPLAY environment variable not found. Calling virtualfb.sh")
+ execute_process(
+ COMMAND __cmake_current_source_dir__/virtualfb.sh start
+ OUTPUT_VARIABLE SVFB_OUT)
+ string(REGEX MATCH "DISPLAY=:[0-9.]*" VFB_DISPLAY_STR "${SVFB_OUT}")
+ string(REGEX MATCH ":[0-9.]*" VFB_DISPLAY "${VFB_DISPLAY_STR}")
+ string(REGEX MATCH "PID=[0-9.]*" VFB_PID_STR "${SVFB_OUT}")
+ string(REPLACE "PID=" "" VFB_PID "${VFB_PID_STR}")
+
+ if (debug_openscad_template)
+ message("Output from virtualfb.sh script: ${SVFB_OUT}")
+ message("Display: ${VFB_DISPLAY}")
+ message("Process ID of vfb: ${VFB_PID}")
+ endif()
+ if ("${VFB_DISPLAY}" STREQUAL "" OR "${VFB_PID}" STREQUAL "")
+ message("Virtual framebuffer had a problem starting.")
+ execute_process("cat virtualfblog")
+ else()
+ message("Virtual framebuffer started. DISPLAY=${VFB_DISPLAY}, PID=${VFB_PID}")
+ endif()
+
+
+ # This line is the heart of the mechanism by which ctest is able to take
+ # the DISPLAY env variable of the Virtual Framebuffer it just started, and
+ # pass it on to its child processes (the tests from CTestTestfile.cmake
+ # in the build directory).
+ set(ENV{DISPLAY} "${VFB_DISPLAY}")
+
+ set(CTEST_CUSTOM_POST_TEST "kill ${VFB_PID}")
+ endif()
+endif()
+
+
+# Part 1. Pretty Printing
+
+message("running 'opencsgtest --info' to generate sysinfo.txt")
+execute_process(COMMAND __wine__ __cmake_current_binary_dir__/opencsgtest --info OUTPUT_FILE sysinfo.txt)
+set(CTEST_CUSTOM_POST_TEST ${CTEST_CUSTOM_POST_TEST} "__python__ __cmake_current_source_dir__/test_pretty_print.py --builddir=__cmake_current_binary_dir__")
+
+if ( ${debug_openscad_template} )
+ foreach(post_test ${CTEST_CUSTOM_POST_TEST} )
+ message("Post test:" ${post_test})
+ endforeach()
+endif()
diff --git a/tests/FindGLEW.cmake b/tests/FindGLEW.cmake
index 1d94ca2..674741d 100644
--- a/tests/FindGLEW.cmake
+++ b/tests/FindGLEW.cmake
@@ -10,56 +10,56 @@
# a few lines of this file are based on the LGPL code found at
# http://openlibraries.org/browser/trunk/FindGLEW.cmake?rev=1383
-include(FindPkgConfig)
+if (WIN32 AND MSVC)
+ if (WIN32_STATIC_BUILD) # passed from caller
+ set(GLEW_LIB_SEARCH_NAME glew32s.lib) # static, non-debug (Release)
+ else ()
+ set(GLEW_LIB_SEARCH_NAME glew32.lib) # other. untested with OpenSCAD
+ endif()
+else () # GCC
+ set(GLEW_LIB_SEARCH_NAME "libglew32s.a")
+endif ()
-if (PKG_CONFIG_FOUND)
- message("Doing pkg config glew check...")
- pkg_check_modules(GLEW glew>=1.6)
+if (WIN32)
+ find_path(GLEW_INCLUDE_DIR GL/glew.h
+ $ENV{PROGRAMFILES}/GLEW/include
+ ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
+ DOC "The directory where GL/glew.h resides")
+ find_library(GLEW_LIBRARY
+ NAMES ${GLEW_LIB_SEARCH_NAME}
+ PATHS
+ $ENV{PROGRAMFILES}/GLEW/lib
+ ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
+ ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
+ DOC "The GLEW library")
+else()
+ find_path(GLEW_INCLUDE_DIR GL/glew.h
+ PATHS /usr/include /usr/local/include /usr/pkg/include
+ DOC "The directory where GL/glew.h resides")
+ find_library(GLEW_LIBRARY
+ NAMES GLEW glew
+ PATHS /usr/lib /usr/local/lib /usr/pkg/lib /lib /lib64 /usr/lib64
+ DOC "The GLEW library")
endif()
-if (GLEW_LIBRARIES)
- set(GLEW_INCLUDE_DIR "${GLEW_INCLUDE_DIRS}")
- set(GLEW_LIBRARY ${GLEW_LDFLAGS})
+if ("${GLEW_INCLUDE_DIR}" STREQUAL "" AND "${GLEW_LIBRARY}" STREQUAL "")
+ set(GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
else()
- if (WIN32 AND MSVC)
- if (WIN32_STATIC_BUILD) # passed from caller
- set(GLEW_LIB_SEARCH_NAME glew32s.lib) # static, non-debug (Release)
- else ()
- set(GLEW_LIB_SEARCH_NAME glew32.lib) # other. untested with OpenSCAD
- endif()
- else () # GCC
- set(GLEW_LIB_SEARCH_NAME "libglew32s.a")
- endif ()
-
- if (WIN32)
- find_path(GLEW_INCLUDE_DIR GL/glew.h
- $ENV{PROGRAMFILES}/GLEW/include
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/include
- DOC "The directory where GL/glew.h resides")
- find_library(GLEW_LIBRARY
- NAMES ${GLEW_LIB_SEARCH_NAME}
- PATHS
- $ENV{PROGRAMFILES}/GLEW/lib
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/bin
- ${PROJECT_SOURCE_DIR}/src/nvgl/glew/lib
- DOC "The GLEW library")
- else (WIN32)
- find_path(GLEW_INCLUDE_DIR GL/glew.h
- PATHS /usr/include /usr/local/include /usr/pkg/include
- NO_DEFAULT_PATH
- DOC "The directory where GL/glew.h resides")
- find_library(GLEW_LIBRARY
- NAMES GLEW glew
- PATHS /usr/lib /usr/local/lib /usr/pkg/lib
- NO_DEFAULT_PATH
- DOC "The GLEW library")
- endif (WIN32)
+ set(GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
+endif()
- if (GLEW_INCLUDE_DIR)
- set(GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
- message(STATUS "GLEW include found in " ${GLEW_INCLUDE_DIR} )
- message(STATUS "GLEW library found in " ${GLEW_LIBRARY} )
- else()
- set(GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
+if (NOT GLEW_FOUND)
+ find_package(PkgConfig REQUIRED)
+ if (PKG_CONFIG_FOUND)
+ message(STATUS "Doing pkg config glew check...")
+ pkg_search_module(GLEW glew)
+ if (GLEW_FOUND)
+ set(GLEW_INCLUDE_DIR "${GLEW_INCLUDEDIR}")
+ set(GLEW_LIBRARY "-L${GLEW_LIBRARY_DIRS} -l${GLEW_LIBRARIES}")
+ endif()
endif()
endif()
+
+if (NOT GLEW_FOUND)
+ message(FATAL_ERROR "GLEW not found")
+endif()
diff --git a/tests/guicgalpngtest.cc b/tests/guicgalpngtest.cc
index 8c4f6de..dd4441c 100644
--- a/tests/guicgalpngtest.cc
+++ b/tests/guicgalpngtest.cc
@@ -9,15 +9,15 @@
#define QUOTE(x) PREQUOTE(x)
int main( int argc, char * argv[] )
{
- printf("%s: wrapper for OpenSCAD at %s\n", argv[0], QUOTE( BINPATH ) );
- if (argc<2 || argc>2) {
- printf("%s: bad number of arguments: %i\n", argv[0], argc);
+ fprintf(stderr,"%s: wrapper for OpenSCAD at %s\n", argv[0], QUOTE( BINPATH ) );
+ if (argc<3 || argc>3) {
+ fprintf(stderr,"%s: bad number of arguments: %i\n", argv[0], argc);
return 1;
}
char *newargs[6];
char *scadfilename = argv[1];
char *pngfile = argv[2];
- newargs[0] = argv[0];
+ newargs[0] = const_cast<char *>(QUOTE( BINPATH ));
newargs[1] = scadfilename;
newargs[2] = const_cast<char *>("-o");
newargs[3] = pngfile;
diff --git a/tests/regression/cgalpngtest/import_stl-tests-expected.png b/tests/regression/cgalpngtest/import_stl-tests-expected.png
index de7638a..c6a4b2d 100644
--- a/tests/regression/cgalpngtest/import_stl-tests-expected.png
+++ b/tests/regression/cgalpngtest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/cgalpngtest/polygon-intersect-expected.png b/tests/regression/cgalpngtest/polygon-intersect-expected.png
index 6f4f437..54e8d6b 100644
--- a/tests/regression/cgalpngtest/polygon-intersect-expected.png
+++ b/tests/regression/cgalpngtest/polygon-intersect-expected.png
Binary files differ
diff --git a/tests/regression/cgalpngtest/polygon-mesh-expected.png b/tests/regression/cgalpngtest/polygon-mesh-expected.png
index 6f4f437..a8fe41a 100644
--- a/tests/regression/cgalpngtest/polygon-mesh-expected.png
+++ b/tests/regression/cgalpngtest/polygon-mesh-expected.png
Binary files differ
diff --git a/tests/regression/cgalpngtest/polygon-self-intersect-expected.png b/tests/regression/cgalpngtest/polygon-self-intersect-expected.png
index 6f4f437..b93b5fb 100644
--- a/tests/regression/cgalpngtest/polygon-self-intersect-expected.png
+++ b/tests/regression/cgalpngtest/polygon-self-intersect-expected.png
Binary files differ
diff --git a/tests/regression/dumptest/import_stl-tests-expected.txt b/tests/regression/dumptest/import_stl-tests-expected.txt
index 947f137..0d46a6f 100644
--- a/tests/regression/dumptest/import_stl-tests-expected.txt
+++ b/tests/regression/dumptest/import_stl-tests-expected.txt
@@ -5,6 +5,9 @@
multmatrix([[1, 0, 0, 4], [0, 1, 0, 0], [0, 0, 1, 0], [0, 0, 0, 1]]) {
import(file = "import_bin.stl", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
}
+ multmatrix([[1, 0, 0, 0], [0, 1, 0, 4], [0, 0, 1, 0], [0, 0, 0, 1]]) {
+ import(file = "import_bin_solid.stl", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
+ }
multmatrix([[1, 0, 0, 0], [0, 1, 0, 2], [0, 0, 1, 0], [0, 0, 0, 1]]) {
import(file = "import.stl", layer = "", origin = [0, 0], scale = 1, convexity = 1, $fn = 0, $fa = 12, $fs = 2);
}
diff --git a/tests/regression/opencsgtest/import_stl-tests-expected.png b/tests/regression/opencsgtest/import_stl-tests-expected.png
index 0bd9ab6..583f3f6 100644
--- a/tests/regression/opencsgtest/import_stl-tests-expected.png
+++ b/tests/regression/opencsgtest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/polygon-intersect-expected.png b/tests/regression/opencsgtest/polygon-intersect-expected.png
index 6f4f437..c0a3cc9 100644
--- a/tests/regression/opencsgtest/polygon-intersect-expected.png
+++ b/tests/regression/opencsgtest/polygon-intersect-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/polygon-mesh-expected.png b/tests/regression/opencsgtest/polygon-mesh-expected.png
index 6f4f437..b907a74 100644
--- a/tests/regression/opencsgtest/polygon-mesh-expected.png
+++ b/tests/regression/opencsgtest/polygon-mesh-expected.png
Binary files differ
diff --git a/tests/regression/opencsgtest/polygon-self-intersect-expected.png b/tests/regression/opencsgtest/polygon-self-intersect-expected.png
index 6f4f437..899bb6f 100644
--- a/tests/regression/opencsgtest/polygon-self-intersect-expected.png
+++ b/tests/regression/opencsgtest/polygon-self-intersect-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/import_stl-tests-expected.png b/tests/regression/throwntogethertest/import_stl-tests-expected.png
index 0bd9ab6..583f3f6 100644
--- a/tests/regression/throwntogethertest/import_stl-tests-expected.png
+++ b/tests/regression/throwntogethertest/import_stl-tests-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/polygon-intersect-expected.png b/tests/regression/throwntogethertest/polygon-intersect-expected.png
index 81eb514..d889f06 100644
--- a/tests/regression/throwntogethertest/polygon-intersect-expected.png
+++ b/tests/regression/throwntogethertest/polygon-intersect-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/polygon-mesh-expected.png b/tests/regression/throwntogethertest/polygon-mesh-expected.png
index 81eb514..1c2751c 100644
--- a/tests/regression/throwntogethertest/polygon-mesh-expected.png
+++ b/tests/regression/throwntogethertest/polygon-mesh-expected.png
Binary files differ
diff --git a/tests/regression/throwntogethertest/polygon-self-intersect-expected.png b/tests/regression/throwntogethertest/polygon-self-intersect-expected.png
index 81eb514..ebce31e 100644
--- a/tests/regression/throwntogethertest/polygon-self-intersect-expected.png
+++ b/tests/regression/throwntogethertest/polygon-self-intersect-expected.png
Binary files differ
diff --git a/tests/test_pretty_print.py b/tests/test_pretty_print.py
index a2a04ed..ed86b65 100755
--- a/tests/test_pretty_print.py
+++ b/tests/test_pretty_print.py
@@ -62,13 +62,16 @@ def ezsearch(pattern,str):
def read_gitinfo():
# won't work if run from outside of branch.
- data = subprocess.Popen(['git','remote','-v'],stdout=subprocess.PIPE).stdout.read()
- origin = ezsearch('^origin *?(.*?)\(fetch.*?$',data)
- upstream = ezsearch('^upstream *?(.*?)\(fetch.*?$',data)
- data = subprocess.Popen(['git','branch'],stdout=subprocess.PIPE).stdout.read()
- branch = ezsearch('^\*(.*?)$',data)
- out = 'Git branch: ' + branch + ' from origin ' + origin + '\n'
- out += 'Git upstream: ' + upstream + '\n'
+ try:
+ data = subprocess.Popen(['git','remote','-v'],stdout=subprocess.PIPE).stdout.read()
+ origin = ezsearch('^origin *?(.*?)\(fetch.*?$',data)
+ upstream = ezsearch('^upstream *?(.*?)\(fetch.*?$',data)
+ data = subprocess.Popen(['git','branch'],stdout=subprocess.PIPE).stdout.read()
+ branch = ezsearch('^\*(.*?)$',data)
+ out = 'Git branch: ' + branch + ' from origin ' + origin + '\n'
+ out += 'Git upstream: ' + upstream + '\n'
+ except:
+ out = 'Problem running git'
return out
def read_sysinfo(filename):
diff --git a/tests/virtualfb.sh b/tests/virtualfb.sh
new file mode 100755
index 0000000..3c0cf0e
--- /dev/null
+++ b/tests/virtualfb.sh
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+if [ "`command -v Xvfb`" ]; then
+ VFB_BINARY=Xvfb
+fi
+
+if [ "`command -v Xvnc`" ]; then
+ VFB_BINARY=Xvnc
+fi
+
+if [ ! $VFB_BINARY ]; then
+ echo "$0 Failed, cannot find Xvfb or Xvnc"
+ exit 1
+fi
+
+DISPLAY=:98
+$VFB_BINARY $DISPLAY -screen 0 800x600x24 &> virtualfblog &
+echo PID=$! " "
+echo DISPLAY=$DISPLAY
+# trap "kill -KILL $xpid ||:" EXIT
+export DISPLAY
+sleep 3
contact: Jan Huwald // Impressum