summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDon Bright <hugh.m.bright@gmail.com>2013-09-22 21:45:38 (GMT)
committerDon Bright <hugh.m.bright@gmail.com>2013-09-22 21:45:38 (GMT)
commitc9f8b7bf6bbe6ad2e4b1289a2c47afd79d0c68c1 (patch)
treec7c364fb8ecc302a1c60146e53f0674e0e6936b6 /tests
parent40a198a0870d53f491ba72a95a57b9f405d031c0 (diff)
parent4ebd8136a83325e67be7a39c9349ec8812aa05c1 (diff)
Merge branch 'issue480' of github.com:openscad/openscad into issue480
Conflicts: tests/CMakeLists.txt
Diffstat (limited to 'tests')
-rw-r--r--tests/CMakeLists.txt51
-rwxr-xr-xtests/dumptest12
-rwxr-xr-xtests/echotest8
-rw-r--r--tests/regression/echotest/builtin-tests-expected.echo (renamed from tests/regression/echotest/builtin-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/dim-all-expected.echo (renamed from tests/regression/echotest/dim-all-expected.txt)0
-rw-r--r--tests/regression/echotest/echo-expected.echo (renamed from tests/regression/echotest/echo-expected.txt)0
-rw-r--r--tests/regression/echotest/echo-tests-expected.echo (renamed from tests/regression/echotest/echo-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/escape-test-expected.echo (renamed from tests/regression/echotest/escape-test-expected.txt)0
-rw-r--r--tests/regression/echotest/expression-shortcircuit-tests-expected.echo (renamed from tests/regression/echotest/expression-shortcircuit-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/inf-tests-expected.echo (renamed from tests/regression/echotest/inf-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/len-tests-expected.echo (renamed from tests/regression/echotest/len-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/lookup-tests-expected.echo (renamed from tests/regression/echotest/lookup-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/parser-tests-expected.echo (renamed from tests/regression/echotest/parser-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/rands-expected.echo (renamed from tests/regression/echotest/rands-expected.txt)0
-rw-r--r--tests/regression/echotest/recursion-tests-expected.echo (renamed from tests/regression/echotest/recursion-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/search-tests-expected.echo (renamed from tests/regression/echotest/search-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/string-indexing-expected.echo (renamed from tests/regression/echotest/string-indexing-expected.txt)0
-rw-r--r--tests/regression/echotest/string-test-expected.echo (renamed from tests/regression/echotest/string-test-expected.txt)0
-rw-r--r--tests/regression/echotest/value-reassignment-tests-expected.echo (renamed from tests/regression/echotest/value-reassignment-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/value-reassignment-tests2-expected.echo (renamed from tests/regression/echotest/value-reassignment-tests2-expected.txt)0
-rw-r--r--tests/regression/echotest/variable-scope-tests-expected.echo (renamed from tests/regression/echotest/variable-scope-tests-expected.txt)0
-rw-r--r--tests/regression/echotest/vector-values-expected.echo (renamed from tests/regression/echotest/vector-values-expected.txt)0
-rwxr-xr-xtests/test_cmdline_tool.py1
23 files changed, 36 insertions, 36 deletions
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 5405d04..8e08204 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -1,5 +1,7 @@
# instructions - see ../doc/testing.txt
+set(DEBUG_OSCD 1) # print debug info during cmake
+
cmake_minimum_required(VERSION 2.8)
if("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}.${CMAKE_PATCH_VERSION}" VERSION_GREATER 2.8.3)
# Explicitly use new include policy to avoid globally shadowing included modules
@@ -38,6 +40,7 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}")
# Build debug build as default
if(NOT CMAKE_BUILD_TYPE)
+<<<<<<< HEAD
# set(CMAKE_BUILD_TYPE Release)
if(CMAKE_COMPILER_IS_GNUCXX)
execute_process(COMMAND ${CMAKE_C_COMPILER} -dumpversion OUTPUT_VARIABLE GCC_VERSION)
@@ -49,6 +52,10 @@ if(NOT CMAKE_BUILD_TYPE)
else()
set(CMAKE_BUILD_TYPE RelWithDebInfo)
endif()
+=======
+ set(CMAKE_BUILD_TYPE RelWithDebInfo)
+# set(CMAKE_BUILD_TYPE Release)
+>>>>>>> 4ebd8136a83325e67be7a39c9349ec8812aa05c1
endif()
if(CMAKE_COMPILER_IS_GNUCXX)
@@ -124,12 +131,15 @@ endif()
#
function(inclusion user_set_path found_paths)
- # If user_set_path indicates an env. variable was specifically
- # set by the user, then found_paths become an include priority (prepend);
- # otherwise found_paths are stuck on the end of the include flags (append).
-
- # message(STATUS "inclusion ${user_set_path} ${found_paths}")
- # message(STATUS "inclusion ${${user_set_path}} ${${found_paths}}")
+ # Set up compiler include paths with prepend/append rules. Input is
+ # a path and a set of paths. If user_set_path matches anything in found_paths
+ # then we prepend the found_paths because we assume the user wants
+ # their set_paths to be a priority.
+
+ if (DEBUG_OSCD)
+ message(STATUS "inclusion ${user_set_path} ${found_paths}")
+ message(STATUS "inclusion ${${user_set_path}} ${${found_paths}}")
+ endif()
set( inclusion_match 0 )
foreach( found_path ${${found_paths}} )
if (${found_path} MATCHES ${${user_set_path}}.*)
@@ -138,10 +148,14 @@ function(inclusion user_set_path found_paths)
endforeach()
if (user_set_path AND inclusion_match)
include_directories(BEFORE ${${found_paths}})
- # message(STATUS "inclusion prepend ${${found_paths}} for ${user_set_path}")
+ if (DEBUG_OSCD)
+ message(STATUS "inclusion prepend ${${found_paths}} for ${user_set_path}")
+ endif()
else()
include_directories(AFTER ${${found_paths}})
- # message(STATUS "inclusion append ${${found_paths}} for ${user_set_path}")
+ if (DEBUG_OSCD)
+ message(STATUS "inclusion append ${${found_paths}} for ${user_set_path}")
+ endif()
endif()
set( inclusion_match 0 )
endfunction()
@@ -339,6 +353,13 @@ if(${CMAKE_SYSTEM_NAME} MATCHES "FreeBSD")
set(FLEX_EXECUTABLE /usr/local/bin/flex)
endif()
+# prepend the dir where deps were built
+if (NOT $ENV{OPENSCAD_LIBRARIES} STREQUAL "")
+ set(OSCAD_DEPS "")
+ set(OSCAD_DEPS_PATHS $ENV{OPENSCAD_LIBRARIES}/include)
+ inclusion(OSCAD_DEPS OSCAD_DEPS_PATHS)
+endif()
+
if(${CMAKE_SYSTEM_NAME} MATCHES "NetBSD")
include_directories( /usr/pkg/include /usr/X11R7/include )
set(FLEX_EXECUTABLE /usr/pkg/bin/flex)
@@ -567,9 +588,9 @@ target_link_libraries(cgalcachetest tests-cgal ${TESTS-CGAL-LIBRARIES} ${GLEW_LI
#
# openscad no-qt
#
-add_executable(openscad ../src/openscad.cc)
-set_target_properties(openscad PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -DEIGEN_DONT_ALIGN -DENABLE_CGAL -DENABLE_OPENCSG ${CGAL_CXX_FLAGS_INIT}")
-target_link_libraries(openscad tests-offscreen tests-cgal tests-nocgal ${TESTS-CORE-LIBRARIES} ${TESTS-CGAL-LIBRARIES} ${GLEW_LIBRARY} ${Boost_LIBRARIES} ${OPENCSG_LIBRARY} ${COCOA_LIBRARY} )
+add_executable(openscad_nogui ../src/openscad.cc)
+set_target_properties(openscad_nogui PROPERTIES COMPILE_FLAGS "-fno-strict-aliasing -DEIGEN_DONT_ALIGN -DENABLE_CGAL -DENABLE_OPENCSG ${CGAL_CXX_FLAGS_INIT}")
+target_link_libraries(openscad_nogui tests-offscreen tests-cgal tests-nocgal ${TESTS-CORE-LIBRARIES} ${TESTS-CGAL-LIBRARIES} ${GLEW_LIBRARY} ${Boost_LIBRARIES} ${OPENCSG_LIBRARY} ${COCOA_LIBRARY} )
#
# GUI binary tests
@@ -596,9 +617,9 @@ target_link_libraries(openscad tests-offscreen tests-cgal tests-nocgal ${TESTS-C
#endif()
if(WIN32)
- set(OPENSCAD_BINPATH "${CMAKE_CURRENT_BINARY_DIR}/openscad.exe")
+ set(OPENSCAD_BINPATH "${CMAKE_CURRENT_BINARY_DIR}/openscad_nogui.exe")
else()
- set(OPENSCAD_BINPATH "${CMAKE_CURRENT_BINARY_DIR}/openscad")
+ set(OPENSCAD_BINPATH "${CMAKE_CURRENT_BINARY_DIR}/openscad_nogui")
endif()
#
@@ -878,8 +899,6 @@ file(WRITE ${CMAKE_CURRENT_BINARY_DIR}/CTestCustom.cmake ${TMP})
# Add tests
-add_cmdline_test(echotest EXE ${CMAKE_SOURCE_DIR}/echotest SUFFIX txt ARGS ${OPENSCAD_BINPATH} FILES ${ECHO_FILES})
-add_cmdline_test(dumptest EXE ${CMAKE_SOURCE_DIR}/dumptest SUFFIX csg ARGS ${OPENSCAD_BINPATH} FILES ${DUMPTEST_FILES})
add_cmdline_test(moduledumptest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX ast FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
@@ -892,6 +911,8 @@ add_cmdline_test(csgtermtest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX term FILES
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allexpressions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allfunctions.scad
${CMAKE_SOURCE_DIR}/../testdata/scad/misc/allmodules.scad)
+add_cmdline_test(echotest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX echo FILES ${ECHO_FILES})
+add_cmdline_test(dumptest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX csg FILES ${DUMPTEST_FILES})
add_cmdline_test(cgalpngtest EXE ${OPENSCAD_BINPATH} ARGS --render -o SUFFIX png FILES ${CGALPNGTEST_FILES})
add_cmdline_test(opencsgtest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX png FILES ${OPENCSGTEST_FILES})
add_cmdline_test(throwntogethertest EXE ${OPENSCAD_BINPATH} ARGS --preview=throwntogether -o SUFFIX png FILES ${THROWNTOGETHERTEST_FILES})
diff --git a/tests/dumptest b/tests/dumptest
deleted file mode 100755
index f9247c7..0000000
--- a/tests/dumptest
+++ /dev/null
@@ -1,12 +0,0 @@
-#!/usr/bin/env python
-
-import re, sys, subprocess
-
-subprocess.check_call([sys.argv[2], sys.argv[1], '-o', sys.argv[3]])
-
-result = open(sys.argv[3]).read()
-
-result = re.sub(r', timestamp = [0-9]*', '', result)
-result = re.sub(r'-?[0-9].[0-9]*e-[0-9]{2,}', '0', result)
-
-open(sys.argv[3], 'w').write(result)
diff --git a/tests/echotest b/tests/echotest
deleted file mode 100755
index a2302ff..0000000
--- a/tests/echotest
+++ /dev/null
@@ -1,8 +0,0 @@
-#!/usr/bin/env python
-
-import re, sys, subprocess
-
-result = subprocess.Popen([sys.argv[2], sys.argv[1], '-o', 'null'], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[1]
-result = re.sub(r'-?[0-9].[0-9]*e-[0-9]{2,}', '0', result)
-
-open(sys.argv[3], 'w').write(result)
diff --git a/tests/regression/echotest/builtin-tests-expected.txt b/tests/regression/echotest/builtin-tests-expected.echo
index 385b0dc..385b0dc 100644
--- a/tests/regression/echotest/builtin-tests-expected.txt
+++ b/tests/regression/echotest/builtin-tests-expected.echo
diff --git a/tests/regression/echotest/dim-all-expected.txt b/tests/regression/echotest/dim-all-expected.echo
index a16c580..a16c580 100644
--- a/tests/regression/echotest/dim-all-expected.txt
+++ b/tests/regression/echotest/dim-all-expected.echo
diff --git a/tests/regression/echotest/echo-expected.txt b/tests/regression/echotest/echo-expected.echo
index 8fc094e..8fc094e 100644
--- a/tests/regression/echotest/echo-expected.txt
+++ b/tests/regression/echotest/echo-expected.echo
diff --git a/tests/regression/echotest/echo-tests-expected.txt b/tests/regression/echotest/echo-tests-expected.echo
index d7ebe2f..d7ebe2f 100644
--- a/tests/regression/echotest/echo-tests-expected.txt
+++ b/tests/regression/echotest/echo-tests-expected.echo
diff --git a/tests/regression/echotest/escape-test-expected.txt b/tests/regression/echotest/escape-test-expected.echo
index e69de29..e69de29 100644
--- a/tests/regression/echotest/escape-test-expected.txt
+++ b/tests/regression/echotest/escape-test-expected.echo
diff --git a/tests/regression/echotest/expression-shortcircuit-tests-expected.txt b/tests/regression/echotest/expression-shortcircuit-tests-expected.echo
index d7f1c40..d7f1c40 100644
--- a/tests/regression/echotest/expression-shortcircuit-tests-expected.txt
+++ b/tests/regression/echotest/expression-shortcircuit-tests-expected.echo
diff --git a/tests/regression/echotest/inf-tests-expected.txt b/tests/regression/echotest/inf-tests-expected.echo
index 7ac4fe9..7ac4fe9 100644
--- a/tests/regression/echotest/inf-tests-expected.txt
+++ b/tests/regression/echotest/inf-tests-expected.echo
diff --git a/tests/regression/echotest/len-tests-expected.txt b/tests/regression/echotest/len-tests-expected.echo
index 2a776c0..2a776c0 100644
--- a/tests/regression/echotest/len-tests-expected.txt
+++ b/tests/regression/echotest/len-tests-expected.echo
diff --git a/tests/regression/echotest/lookup-tests-expected.txt b/tests/regression/echotest/lookup-tests-expected.echo
index b98ebe2..b98ebe2 100644
--- a/tests/regression/echotest/lookup-tests-expected.txt
+++ b/tests/regression/echotest/lookup-tests-expected.echo
diff --git a/tests/regression/echotest/parser-tests-expected.txt b/tests/regression/echotest/parser-tests-expected.echo
index 615726a..615726a 100644
--- a/tests/regression/echotest/parser-tests-expected.txt
+++ b/tests/regression/echotest/parser-tests-expected.echo
diff --git a/tests/regression/echotest/rands-expected.txt b/tests/regression/echotest/rands-expected.echo
index 36ac6cd..36ac6cd 100644
--- a/tests/regression/echotest/rands-expected.txt
+++ b/tests/regression/echotest/rands-expected.echo
diff --git a/tests/regression/echotest/recursion-tests-expected.txt b/tests/regression/echotest/recursion-tests-expected.echo
index e5c99b1..e5c99b1 100644
--- a/tests/regression/echotest/recursion-tests-expected.txt
+++ b/tests/regression/echotest/recursion-tests-expected.echo
diff --git a/tests/regression/echotest/search-tests-expected.txt b/tests/regression/echotest/search-tests-expected.echo
index 0269f43..0269f43 100644
--- a/tests/regression/echotest/search-tests-expected.txt
+++ b/tests/regression/echotest/search-tests-expected.echo
diff --git a/tests/regression/echotest/string-indexing-expected.txt b/tests/regression/echotest/string-indexing-expected.echo
index 3fcdfa4..3fcdfa4 100644
--- a/tests/regression/echotest/string-indexing-expected.txt
+++ b/tests/regression/echotest/string-indexing-expected.echo
diff --git a/tests/regression/echotest/string-test-expected.txt b/tests/regression/echotest/string-test-expected.echo
index 1969a74..1969a74 100644
--- a/tests/regression/echotest/string-test-expected.txt
+++ b/tests/regression/echotest/string-test-expected.echo
diff --git a/tests/regression/echotest/value-reassignment-tests-expected.txt b/tests/regression/echotest/value-reassignment-tests-expected.echo
index 344f7ab..344f7ab 100644
--- a/tests/regression/echotest/value-reassignment-tests-expected.txt
+++ b/tests/regression/echotest/value-reassignment-tests-expected.echo
diff --git a/tests/regression/echotest/value-reassignment-tests2-expected.txt b/tests/regression/echotest/value-reassignment-tests2-expected.echo
index efb1be7..efb1be7 100644
--- a/tests/regression/echotest/value-reassignment-tests2-expected.txt
+++ b/tests/regression/echotest/value-reassignment-tests2-expected.echo
diff --git a/tests/regression/echotest/variable-scope-tests-expected.txt b/tests/regression/echotest/variable-scope-tests-expected.echo
index 2a82090..2a82090 100644
--- a/tests/regression/echotest/variable-scope-tests-expected.txt
+++ b/tests/regression/echotest/variable-scope-tests-expected.echo
diff --git a/tests/regression/echotest/vector-values-expected.txt b/tests/regression/echotest/vector-values-expected.echo
index 78053b9..78053b9 100644
--- a/tests/regression/echotest/vector-values-expected.txt
+++ b/tests/regression/echotest/vector-values-expected.echo
diff --git a/tests/test_cmdline_tool.py b/tests/test_cmdline_tool.py
index 470be1e..6977a88 100755
--- a/tests/test_cmdline_tool.py
+++ b/tests/test_cmdline_tool.py
@@ -1,4 +1,3 @@
-#!/usr/bin/env python
#
# Regression test driver for cmd-line tools
contact: Jan Huwald // Impressum