From 47ed2f1b1262c0bda78153c9cebf576b571a7bb4 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 21 Sep 2013 00:12:42 -0500 Subject: moving towards making tests work on bsd again diff --git a/scripts/setenv-unibuild.sh b/scripts/setenv-unibuild.sh index cb0b0a0..d5ccb75 100644 --- a/scripts/setenv-unibuild.sh +++ b/scripts/setenv-unibuild.sh @@ -51,6 +51,9 @@ setenv_freebsd() setenv_netbsd() { setenv_common + echo --- netbsd build situation is complex. it comes with gcc4.5 + echo --- which is incompatable with updated CGAL. + echo --- you may need to hack with newer gcc to make it work QMAKESPEC=netbsd-g++ QTDIR=/usr/pkg/qt4 PATH=/usr/pkg/qt4/bin:$PATH @@ -75,6 +78,19 @@ setenv_linux_clang() echo QMAKESPEC has been modified: $QMAKESPEC } +setenv_netbsd_clang() +{ + echo --------------------- this is not yet supported. netbsd 6 lacks + echo --------------------- certain things needed for clang support + export CC=clang + export CXX=clang++ + export QMAKESPEC=./patches/mkspecs/netbsd-clang + + echo CC has been modified: $CC + echo CXX has been modified: $CXX + echo QMAKESPEC has been modified: $QMAKESPEC +} + clean_note() { if [ $QT5_SETUP ]; then @@ -127,6 +143,9 @@ elif [ "`uname | grep -i freebsd`" ]; then setenv_freebsd elif [ "`uname | grep -i netbsd`" ]; then setenv_netbsd + if [ "`echo $* | grep clang`" ]; then + setenv_netbsd_clang + fi else # guess setenv_common diff --git a/scripts/uni-build-dependencies.sh b/scripts/uni-build-dependencies.sh index 6596c8a..f55e195 100755 --- a/scripts/uni-build-dependencies.sh +++ b/scripts/uni-build-dependencies.sh @@ -282,6 +282,7 @@ build_cgal() echo "Building CGAL" $version "..." cd $BASEDIR/src rm -rf CGAL-$version + ver4_2="curl --insecure -O https://gforge.inria.fr/frs/download.php/32360/CGAL-4.2.tar.bz2" ver4_1="curl --insecure -O https://gforge.inria.fr/frs/download.php/31640/CGAL-4.1.tar.bz2" ver4_0_2="curl --insecure -O https://gforge.inria.fr/frs/download.php/31174/CGAL-4.0.2.tar.bz2" ver4_0="curl --insecure -O https://gforge.inria.fr/frs/download.php/30387/CGAL-4.0.tar.gz" @@ -289,7 +290,7 @@ build_cgal() ver3_8="curl --insecure -O https://gforge.inria.fr/frs/download.php/28500/CGAL-3.8.tar.gz" ver3_7="curl --insecure -O https://gforge.inria.fr/frs/download.php/27641/CGAL-3.7.tar.gz" vernull="echo already downloaded..skipping" - download_cmd=ver`echo $version | sed s/"\."/"_"/` + download_cmd=ver`echo $version | sed s/"\."/"_"/ | sed s/"\."/"_"/` if [ -e CGAL-$version.tar.gz ]; then download_cmd=vernull; @@ -298,6 +299,7 @@ build_cgal() download_cmd=vernull; fi + eval echo "$"$download_cmd `eval echo "$"$download_cmd` zipper=gzip @@ -563,7 +565,7 @@ if [ $1 ]; then exit $? fi if [ $1 = "cgal" ]; then - build_cgal 4.1 use-sys-libs + build_cgal 4.0.2 use-sys-libs exit $? fi if [ $1 = "opencsg" ]; then @@ -592,7 +594,7 @@ build_gmp 5.0.5 build_mpfr 3.1.1 build_boost 1.53.0 # NB! For CGAL, also update the actual download URL in the function -build_cgal 4.1 +build_cgal 4.0.2 build_glew 1.9.0 build_opencsg 1.3.2 diff --git a/src/openscad.cc b/src/openscad.cc index 5a219ac..d8ce112 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -83,6 +83,16 @@ using std::vector; using boost::lexical_cast; using boost::is_any_of; +static void echotest_output_handler( const std::string &msg, void *userdata ) +{ + std::ofstream *outstream = static_cast(userdata); + if (!outstream->is_open()) { + fprintf(stderr,"Error writing outstream\n" ); + return; + } + *outstream << msg; +} + static void help(const char *progname) { int tab = int(strlen(progname))+8; @@ -191,7 +201,7 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *png_output_file = NULL; const char *ast_output_file = NULL; const char *term_output_file = NULL; - bool null_output = false; + const char *echotest_output_file = NULL; std::string suffix = boosty::extension_str( output_file ); boost::algorithm::to_lower( suffix ); @@ -203,7 +213,7 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, else if (suffix == ".png") png_output_file = output_file; else if (suffix == ".ast") ast_output_file = output_file; else if (suffix == ".term") term_output_file = output_file; - else if (strcmp(output_file, "null") == 0) null_output = true; + else if (suffix == ".echotest") echotest_output_file = output_file; else { fprintf(stderr, "Unknown suffix for output file %s\n", output_file); return 1; @@ -216,6 +226,15 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, top_ctx.dump(NULL, NULL); #endif + if (echotest_output_file) { + std::ofstream fstream( echotest_output_file ); + if (!fstream.is_open()) { + PRINTB("Can't open file \"%s\" for export", csg_output_file); + } else { + set_output_handler( echotest_output_handler, fstream ); + } + } + FileModule *root_module; ModuleInstantiation root_inst("group"); AbstractNode *root_node; @@ -301,8 +320,8 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, } else { #ifdef ENABLE_CGAL - if ((null_output || png_output_file) && !(renderer==Render::CGAL)) { - // null output or OpenCSG png -> don't necessarily need CGALMesh evaluation + if ((echotest_output_file || png_output_file) && !(renderer==Render::CGAL)) { + // echotest or OpenCSG png -> don't necessarily need CGALMesh evaluation } else { root_N = cgalevaluator.evaluateCGALMesh(*tree.root()); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 387d6ee..4c4bf9f 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 @@ -115,12 +117,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}}.*) @@ -129,10 +134,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() @@ -330,6 +339,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) @@ -558,9 +574,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 @@ -587,9 +603,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() # @@ -869,8 +885,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 @@ -883,6 +897,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 echotest FILES ${ECHO_FILES}) +add_cmdline_test(dumptest EXE ${OPENSCAD_BINPATH} ARGS -o dump 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/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 -- cgit v0.10.1 From efc6731774ca6e0da4453921ab0daeadc44ee8bc Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 21 Sep 2013 09:04:01 -0500 Subject: make echotest work on BSD, by adding .echo as recognized extension diff --git a/doc/testing.txt b/doc/testing.txt index f609b65..5617e61 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -73,7 +73,6 @@ Two tests still need an intermediate script that mangles away timestamps and near-zero floating point numbers: * dumptest -* echotest * cgalstlsanitytest Some tests are yet to be converted: @@ -85,15 +84,6 @@ These look like tests, but are not actually in use: * modulecachetest * cgalcachetest -In the course of migration, the possibilities of using the OPENSCAD_TESTING -compile time flag go away; that flag used to strip timestamps out of files, -to unify float output, and to tweak the file inclusion paths. With that flag -unused, we get better coverage of the primary code paths, at the cost of -having to do some normalization in the unit testing process (thus the dumptest -and echo test scripts). Especially, having a nonstandard MCAD library in the -user include path can now break things -- but so can having misbehaving -programs in your PATH. - Troubleshooting: ------------------------------ diff --git a/src/openscad.cc b/src/openscad.cc index d8ce112..82afc16 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -83,15 +83,18 @@ using std::vector; using boost::lexical_cast; using boost::is_any_of; -static void echotest_output_handler( const std::string &msg, void *userdata ) +class Echostream : public std::ofstream { - std::ofstream *outstream = static_cast(userdata); - if (!outstream->is_open()) { - fprintf(stderr,"Error writing outstream\n" ); - return; +public: + Echostream( const char * filename ) : std::ofstream( filename ) + { + set_output_handler( &Echostream::output, this ); } - *outstream << msg; -} + static void output( const std::string &msg, void *userdata ) { + Echostream *thisp = static_cast(userdata); + *thisp << msg << "\n"; + } +}; static void help(const char *progname) { @@ -186,7 +189,7 @@ Camera get_camera( po::variables_map vm ) return camera; } -int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *output_file, fs::path original_path, Render::type renderer, char ** argv ) +int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *output_file, fs::path original_path, Render::type renderer, char ** argv, bool echo ) { parser_init(boosty::stringy(boost::filesystem::path( argv[0] ).parent_path())); Tree tree; @@ -201,7 +204,7 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *png_output_file = NULL; const char *ast_output_file = NULL; const char *term_output_file = NULL; - const char *echotest_output_file = NULL; + const char *echo_output_file = NULL; std::string suffix = boosty::extension_str( output_file ); boost::algorithm::to_lower( suffix ); @@ -213,7 +216,7 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, else if (suffix == ".png") png_output_file = output_file; else if (suffix == ".ast") ast_output_file = output_file; else if (suffix == ".term") term_output_file = output_file; - else if (suffix == ".echotest") echotest_output_file = output_file; + else if (suffix == ".echo") echo_output_file = output_file; else { fprintf(stderr, "Unknown suffix for output file %s\n", output_file); return 1; @@ -226,14 +229,8 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, top_ctx.dump(NULL, NULL); #endif - if (echotest_output_file) { - std::ofstream fstream( echotest_output_file ); - if (!fstream.is_open()) { - PRINTB("Can't open file \"%s\" for export", csg_output_file); - } else { - set_output_handler( echotest_output_handler, fstream ); - } - } + Echostream *echostream; + if (echo_output_file) echostream = new Echostream( echo_output_file ); FileModule *root_module; ModuleInstantiation root_inst("group"); @@ -273,6 +270,8 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, tree.setRoot(root_node); + if (echostream) echostream->close(); + if (csg_output_file) { fs::current_path(original_path); std::ofstream fstream(csg_output_file); @@ -320,8 +319,8 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, } else { #ifdef ENABLE_CGAL - if ((echotest_output_file || png_output_file) && !(renderer==Render::CGAL)) { - // echotest or OpenCSG png -> don't necessarily need CGALMesh evaluation + if ((echo_output_file || png_output_file) && !(renderer==Render::CGAL)) { + // echo or OpenCSG png -> don't necessarily need CGALMesh evaluation } else { root_N = cgalevaluator.evaluateCGALMesh(*tree.root()); } diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 4c4bf9f..61a3520 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -897,7 +897,7 @@ 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 echotest FILES ${ECHO_FILES}) +add_cmdline_test(echotest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX echo FILES ${ECHO_FILES}) add_cmdline_test(dumptest EXE ${OPENSCAD_BINPATH} ARGS -o dump 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}) diff --git a/tests/regression/echotest/builtin-tests-expected.echo b/tests/regression/echotest/builtin-tests-expected.echo new file mode 100644 index 0000000..385b0dc --- /dev/null +++ b/tests/regression/echotest/builtin-tests-expected.echo @@ -0,0 +1 @@ +ECHO: 3.14159265359 diff --git a/tests/regression/echotest/builtin-tests-expected.txt b/tests/regression/echotest/builtin-tests-expected.txt deleted file mode 100644 index 385b0dc..0000000 --- a/tests/regression/echotest/builtin-tests-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: 3.14159265359 diff --git a/tests/regression/echotest/dim-all-expected.echo b/tests/regression/echotest/dim-all-expected.echo new file mode 100644 index 0000000..a16c580 --- /dev/null +++ b/tests/regression/echotest/dim-all-expected.echo @@ -0,0 +1,16 @@ +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: linearX = 51.44957554275 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: linearY = 29.13025467434 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: aligned = 60 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: ordinateX = -49.17542445724 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: ordinateY = 30.86974532565 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: radius = 60 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: diameter = 120 +WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". +ECHO: arc = 59.03624346792 diff --git a/tests/regression/echotest/dim-all-expected.txt b/tests/regression/echotest/dim-all-expected.txt deleted file mode 100644 index a16c580..0000000 --- a/tests/regression/echotest/dim-all-expected.txt +++ /dev/null @@ -1,16 +0,0 @@ -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: linearX = 51.44957554275 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: linearY = 29.13025467434 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: aligned = 60 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: ordinateX = -49.17542445724 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: ordinateY = 30.86974532565 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: radius = 60 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: diameter = 120 -WARNING: Unsupported DXF Entity 'LEADER' (1) in "dim-all.dxf". -ECHO: arc = 59.03624346792 diff --git a/tests/regression/echotest/echo-expected.echo b/tests/regression/echotest/echo-expected.echo new file mode 100644 index 0000000..8fc094e --- /dev/null +++ b/tests/regression/echotest/echo-expected.echo @@ -0,0 +1 @@ +ECHO: diff --git a/tests/regression/echotest/echo-expected.txt b/tests/regression/echotest/echo-expected.txt deleted file mode 100644 index 8fc094e..0000000 --- a/tests/regression/echotest/echo-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: diff --git a/tests/regression/echotest/echo-tests-expected.echo b/tests/regression/echotest/echo-tests-expected.echo new file mode 100644 index 0000000..d7ebe2f --- /dev/null +++ b/tests/regression/echotest/echo-tests-expected.echo @@ -0,0 +1,10 @@ +ECHO: undef +ECHO: "string" +ECHO: "stringvar" +ECHO: a = 1, b = 2, true, c = false +ECHO: [1, "vecstr", 2.34, false] +ECHO: [1 : 2 : 10] +ECHO: vec = [1, 2, 3] +ECHO: range = [0 : 1 : 2] +ECHO: "string generated by str()" +ECHO: 0.8 diff --git a/tests/regression/echotest/echo-tests-expected.txt b/tests/regression/echotest/echo-tests-expected.txt deleted file mode 100644 index d7ebe2f..0000000 --- a/tests/regression/echotest/echo-tests-expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -ECHO: undef -ECHO: "string" -ECHO: "stringvar" -ECHO: a = 1, b = 2, true, c = false -ECHO: [1, "vecstr", 2.34, false] -ECHO: [1 : 2 : 10] -ECHO: vec = [1, 2, 3] -ECHO: range = [0 : 1 : 2] -ECHO: "string generated by str()" -ECHO: 0.8 diff --git a/tests/regression/echotest/escape-test-expected.echo b/tests/regression/echotest/escape-test-expected.echo new file mode 100644 index 0000000..e69de29 diff --git a/tests/regression/echotest/escape-test-expected.txt b/tests/regression/echotest/escape-test-expected.txt deleted file mode 100644 index e69de29..0000000 diff --git a/tests/regression/echotest/expression-shortcircuit-tests-expected.echo b/tests/regression/echotest/expression-shortcircuit-tests-expected.echo new file mode 100644 index 0000000..d7f1c40 --- /dev/null +++ b/tests/regression/echotest/expression-shortcircuit-tests-expected.echo @@ -0,0 +1,5 @@ +ECHO: "Pass" +ECHO: "Pass" +ECHO: "Pass" +ECHO: "Pass" +ECHO: "Pass" diff --git a/tests/regression/echotest/expression-shortcircuit-tests-expected.txt b/tests/regression/echotest/expression-shortcircuit-tests-expected.txt deleted file mode 100644 index d7f1c40..0000000 --- a/tests/regression/echotest/expression-shortcircuit-tests-expected.txt +++ /dev/null @@ -1,5 +0,0 @@ -ECHO: "Pass" -ECHO: "Pass" -ECHO: "Pass" -ECHO: "Pass" -ECHO: "Pass" diff --git a/tests/regression/echotest/inf-tests-expected.echo b/tests/regression/echotest/inf-tests-expected.echo new file mode 100644 index 0000000..7ac4fe9 --- /dev/null +++ b/tests/regression/echotest/inf-tests-expected.echo @@ -0,0 +1,23 @@ +ECHO: inf +ECHO: -inf +ECHO: nan +ECHO: nan +ECHO: nan +ECHO: nan +ECHO: nan +ECHO: 90 +ECHO: -90 +ECHO: 135 +ECHO: inf +ECHO: inf +ECHO: undef +ECHO: inf +ECHO: inf +ECHO: inf +ECHO: -inf +ECHO: inf +ECHO: inf +ECHO: 1 +ECHO: -1 +ECHO: inf +ECHO: nan diff --git a/tests/regression/echotest/inf-tests-expected.txt b/tests/regression/echotest/inf-tests-expected.txt deleted file mode 100644 index 7ac4fe9..0000000 --- a/tests/regression/echotest/inf-tests-expected.txt +++ /dev/null @@ -1,23 +0,0 @@ -ECHO: inf -ECHO: -inf -ECHO: nan -ECHO: nan -ECHO: nan -ECHO: nan -ECHO: nan -ECHO: 90 -ECHO: -90 -ECHO: 135 -ECHO: inf -ECHO: inf -ECHO: undef -ECHO: inf -ECHO: inf -ECHO: inf -ECHO: -inf -ECHO: inf -ECHO: inf -ECHO: 1 -ECHO: -1 -ECHO: inf -ECHO: nan diff --git a/tests/regression/echotest/len-tests-expected.echo b/tests/regression/echotest/len-tests-expected.echo new file mode 100644 index 0000000..2a776c0 --- /dev/null +++ b/tests/regression/echotest/len-tests-expected.echo @@ -0,0 +1,7 @@ +ECHO: 4 +ECHO: 4 +ECHO: 0 +ECHO: 0 +ECHO: 2 +ECHO: 3 +ECHO: undef diff --git a/tests/regression/echotest/len-tests-expected.txt b/tests/regression/echotest/len-tests-expected.txt deleted file mode 100644 index 2a776c0..0000000 --- a/tests/regression/echotest/len-tests-expected.txt +++ /dev/null @@ -1,7 +0,0 @@ -ECHO: 4 -ECHO: 4 -ECHO: 0 -ECHO: 0 -ECHO: 2 -ECHO: 3 -ECHO: undef diff --git a/tests/regression/echotest/lookup-tests-expected.echo b/tests/regression/echotest/lookup-tests-expected.echo new file mode 100644 index 0000000..b98ebe2 --- /dev/null +++ b/tests/regression/echotest/lookup-tests-expected.echo @@ -0,0 +1,15 @@ +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: 0 +ECHO: 0.5 +ECHO: -55 +ECHO: -55 +ECHO: -54.44444444444 +ECHO: -2.5 +ECHO: 0 +ECHO: 0.9 +ECHO: 6.66666666666 +ECHO: 333 +ECHO: 333 diff --git a/tests/regression/echotest/lookup-tests-expected.txt b/tests/regression/echotest/lookup-tests-expected.txt deleted file mode 100644 index b98ebe2..0000000 --- a/tests/regression/echotest/lookup-tests-expected.txt +++ /dev/null @@ -1,15 +0,0 @@ -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: 0 -ECHO: 0.5 -ECHO: -55 -ECHO: -55 -ECHO: -54.44444444444 -ECHO: -2.5 -ECHO: 0 -ECHO: 0.9 -ECHO: 6.66666666666 -ECHO: 333 -ECHO: 333 diff --git a/tests/regression/echotest/parser-tests-expected.echo b/tests/regression/echotest/parser-tests-expected.echo new file mode 100644 index 0000000..615726a --- /dev/null +++ b/tests/regression/echotest/parser-tests-expected.echo @@ -0,0 +1,5 @@ +ECHO: 0.1 +ECHO: 2 +ECHO: 1100 +ECHO: 0.021 +ECHO: 0 diff --git a/tests/regression/echotest/parser-tests-expected.txt b/tests/regression/echotest/parser-tests-expected.txt deleted file mode 100644 index 615726a..0000000 --- a/tests/regression/echotest/parser-tests-expected.txt +++ /dev/null @@ -1,5 +0,0 @@ -ECHO: 0.1 -ECHO: 2 -ECHO: 1100 -ECHO: 0.021 -ECHO: 0 diff --git a/tests/regression/echotest/rands-expected.echo b/tests/regression/echotest/rands-expected.echo new file mode 100644 index 0000000..36ac6cd --- /dev/null +++ b/tests/regression/echotest/rands-expected.echo @@ -0,0 +1,3 @@ +WARNING: Ignoring unknown variable 'v'. +ECHO: "i hope rands() did not crash" +ECHO: [1, 1, 1, 1] diff --git a/tests/regression/echotest/rands-expected.txt b/tests/regression/echotest/rands-expected.txt deleted file mode 100644 index 36ac6cd..0000000 --- a/tests/regression/echotest/rands-expected.txt +++ /dev/null @@ -1,3 +0,0 @@ -WARNING: Ignoring unknown variable 'v'. -ECHO: "i hope rands() did not crash" -ECHO: [1, 1, 1, 1] diff --git a/tests/regression/echotest/recursion-tests-expected.echo b/tests/regression/echotest/recursion-tests-expected.echo new file mode 100644 index 0000000..e5c99b1 --- /dev/null +++ b/tests/regression/echotest/recursion-tests-expected.echo @@ -0,0 +1,2 @@ +ERROR: Recursion detected calling function 'crash' +ECHO: undef diff --git a/tests/regression/echotest/recursion-tests-expected.txt b/tests/regression/echotest/recursion-tests-expected.txt deleted file mode 100644 index e5c99b1..0000000 --- a/tests/regression/echotest/recursion-tests-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ -ERROR: Recursion detected calling function 'crash' -ECHO: undef diff --git a/tests/regression/echotest/search-tests-expected.echo b/tests/regression/echotest/search-tests-expected.echo new file mode 100644 index 0000000..0269f43 --- /dev/null +++ b/tests/regression/echotest/search-tests-expected.echo @@ -0,0 +1,20 @@ + WARNING: search term not found: "q" + WARNING: search term not found: 1000 + WARNING: search term not found: "zzz" + WARNING: search term not found: "zzz" + WARNING: search term not found: 500 + WARNING: search term not found: "" +ECHO: "Characters in string (\"a\"): [0]" +ECHO: "Characters in string (\"adeq\"): [[0, 5], [3, 8], [4], []]" +ECHO: "Default string search (\"abe\"): [0, 1, 8]" +ECHO: "Return all matches for string search (\"abe\"): [[0, 4, 9, 10], [1, 5], [8]]" +ECHO: "Return up to 2 matches for string search (\"abe\"): [[0, 4], [1, 5], [8]]" +ECHO: "Return up to 2 matches for string search; alternate columns (\"aebe\"): [[0, 4], [8], [1, 5], [8]]" +ECHO: "Default number search (7): [5]" +ECHO: "Return all matches for number search (1): [0, 4, 10]" +ECHO: "Return up to 2 matches for number search (1): [0, 4]" +ECHO: "Default list number search ([1, 3, 1000]): [0, 1, []]" +ECHO: "Default list string search ([\"b\", \"zzz\", \"a\", \"c\", \"apple\", \"dog\"]): [1, [], 4, 2, 9, 3]" +ECHO: "Default list mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [1, 3, [], 2, 9, [], 4, []]" +ECHO: "Return all matches for mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [[1, 5], [3], [], [2, 6], [9], [], [4, 10], []]" +ECHO: "Return all matches for mixed search; alternate columns ([1, \"zz\", \"dog\", 500, 11]): [[0], [], [3], [], [10]]" diff --git a/tests/regression/echotest/search-tests-expected.txt b/tests/regression/echotest/search-tests-expected.txt deleted file mode 100644 index 0269f43..0000000 --- a/tests/regression/echotest/search-tests-expected.txt +++ /dev/null @@ -1,20 +0,0 @@ - WARNING: search term not found: "q" - WARNING: search term not found: 1000 - WARNING: search term not found: "zzz" - WARNING: search term not found: "zzz" - WARNING: search term not found: 500 - WARNING: search term not found: "" -ECHO: "Characters in string (\"a\"): [0]" -ECHO: "Characters in string (\"adeq\"): [[0, 5], [3, 8], [4], []]" -ECHO: "Default string search (\"abe\"): [0, 1, 8]" -ECHO: "Return all matches for string search (\"abe\"): [[0, 4, 9, 10], [1, 5], [8]]" -ECHO: "Return up to 2 matches for string search (\"abe\"): [[0, 4], [1, 5], [8]]" -ECHO: "Return up to 2 matches for string search; alternate columns (\"aebe\"): [[0, 4], [8], [1, 5], [8]]" -ECHO: "Default number search (7): [5]" -ECHO: "Return all matches for number search (1): [0, 4, 10]" -ECHO: "Return up to 2 matches for number search (1): [0, 4]" -ECHO: "Default list number search ([1, 3, 1000]): [0, 1, []]" -ECHO: "Default list string search ([\"b\", \"zzz\", \"a\", \"c\", \"apple\", \"dog\"]): [1, [], 4, 2, 9, 3]" -ECHO: "Default list mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [1, 3, [], 2, 9, [], 4, []]" -ECHO: "Return all matches for mixed search ([\"b\", 4, \"zzz\", \"c\", \"apple\", 500, \"a\", \"\"]): [[1, 5], [3], [], [2, 6], [9], [], [4, 10], []]" -ECHO: "Return all matches for mixed search; alternate columns ([1, \"zz\", \"dog\", 500, 11]): [[0], [], [3], [], [10]]" diff --git a/tests/regression/echotest/string-indexing-expected.echo b/tests/regression/echotest/string-indexing-expected.echo new file mode 100644 index 0000000..3fcdfa4 --- /dev/null +++ b/tests/regression/echotest/string-indexing-expected.echo @@ -0,0 +1,11 @@ +ECHO: "t" +ECHO: "e" +ECHO: "s" +ECHO: "t" +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: undef +ECHO: "e" diff --git a/tests/regression/echotest/string-indexing-expected.txt b/tests/regression/echotest/string-indexing-expected.txt deleted file mode 100644 index 3fcdfa4..0000000 --- a/tests/regression/echotest/string-indexing-expected.txt +++ /dev/null @@ -1,11 +0,0 @@ -ECHO: "t" -ECHO: "e" -ECHO: "s" -ECHO: "t" -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: undef -ECHO: "e" diff --git a/tests/regression/echotest/string-test-expected.echo b/tests/regression/echotest/string-test-expected.echo new file mode 100644 index 0000000..1969a74 --- /dev/null +++ b/tests/regression/echotest/string-test-expected.echo @@ -0,0 +1 @@ +ECHO: "The quick brown fox \tjumps \"over\" the lazy dog. The quick brown fox.\nThe \\lazy\\ dog." diff --git a/tests/regression/echotest/string-test-expected.txt b/tests/regression/echotest/string-test-expected.txt deleted file mode 100644 index 1969a74..0000000 --- a/tests/regression/echotest/string-test-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: "The quick brown fox \tjumps \"over\" the lazy dog. The quick brown fox.\nThe \\lazy\\ dog." diff --git a/tests/regression/echotest/value-reassignment-tests-expected.echo b/tests/regression/echotest/value-reassignment-tests-expected.echo new file mode 100644 index 0000000..344f7ab --- /dev/null +++ b/tests/regression/echotest/value-reassignment-tests-expected.echo @@ -0,0 +1,2 @@ +WARNING: Ignoring unknown variable 'i'. +ECHO: undef, 2 diff --git a/tests/regression/echotest/value-reassignment-tests-expected.txt b/tests/regression/echotest/value-reassignment-tests-expected.txt deleted file mode 100644 index 344f7ab..0000000 --- a/tests/regression/echotest/value-reassignment-tests-expected.txt +++ /dev/null @@ -1,2 +0,0 @@ -WARNING: Ignoring unknown variable 'i'. -ECHO: undef, 2 diff --git a/tests/regression/echotest/value-reassignment-tests2-expected.echo b/tests/regression/echotest/value-reassignment-tests2-expected.echo new file mode 100644 index 0000000..efb1be7 --- /dev/null +++ b/tests/regression/echotest/value-reassignment-tests2-expected.echo @@ -0,0 +1 @@ +ECHO: 3, 3 diff --git a/tests/regression/echotest/value-reassignment-tests2-expected.txt b/tests/regression/echotest/value-reassignment-tests2-expected.txt deleted file mode 100644 index efb1be7..0000000 --- a/tests/regression/echotest/value-reassignment-tests2-expected.txt +++ /dev/null @@ -1 +0,0 @@ -ECHO: 3, 3 diff --git a/tests/regression/echotest/variable-scope-tests-expected.echo b/tests/regression/echotest/variable-scope-tests-expected.echo new file mode 100644 index 0000000..2a82090 --- /dev/null +++ b/tests/regression/echotest/variable-scope-tests-expected.echo @@ -0,0 +1,27 @@ +ECHO: "special variable inheritance" +ECHO: 23, 5 +WARNING: Ignoring unknown variable 'a'. +ECHO: undef +ECHO: 23, 5 +ECHO: "$children scope" +ECHO: "$children should be 1: ", 1 +ECHO: "$children should be 4: ", 4 +ECHO: "$children should be 1: ", 1 +ECHO: "child_module_1 child" +ECHO: "child_module_2 child 0" +ECHO: "child_module_2 child 1" +ECHO: "copy $children" +ECHO: "copy_children_module: ", 2, 2 +ECHO: "inner variables shadows parameter" +ECHO: 5, 24 +ECHO: "user-defined special variables as parameter" +ECHO: 7 +ECHO: 7 +ECHO: "assign only visible in children's scope" +WARNING: Ignoring unknown variable 'c'. +ECHO: undef +ECHO: 5 +ECHO: "undeclared variable can still be passed and used" +ECHO: 6 +ECHO: "attempt to assign from a not-yet-defined variable which also exists globally" +ECHO: 5, 1 diff --git a/tests/regression/echotest/variable-scope-tests-expected.txt b/tests/regression/echotest/variable-scope-tests-expected.txt deleted file mode 100644 index 2a82090..0000000 --- a/tests/regression/echotest/variable-scope-tests-expected.txt +++ /dev/null @@ -1,27 +0,0 @@ -ECHO: "special variable inheritance" -ECHO: 23, 5 -WARNING: Ignoring unknown variable 'a'. -ECHO: undef -ECHO: 23, 5 -ECHO: "$children scope" -ECHO: "$children should be 1: ", 1 -ECHO: "$children should be 4: ", 4 -ECHO: "$children should be 1: ", 1 -ECHO: "child_module_1 child" -ECHO: "child_module_2 child 0" -ECHO: "child_module_2 child 1" -ECHO: "copy $children" -ECHO: "copy_children_module: ", 2, 2 -ECHO: "inner variables shadows parameter" -ECHO: 5, 24 -ECHO: "user-defined special variables as parameter" -ECHO: 7 -ECHO: 7 -ECHO: "assign only visible in children's scope" -WARNING: Ignoring unknown variable 'c'. -ECHO: undef -ECHO: 5 -ECHO: "undeclared variable can still be passed and used" -ECHO: 6 -ECHO: "attempt to assign from a not-yet-defined variable which also exists globally" -ECHO: 5, 1 diff --git a/tests/regression/echotest/vector-values-expected.echo b/tests/regression/echotest/vector-values-expected.echo new file mode 100644 index 0000000..78053b9 --- /dev/null +++ b/tests/regression/echotest/vector-values-expected.echo @@ -0,0 +1,10 @@ +ECHO: "Testing vector dot product: 14" +ECHO: " Bounds check: undef" +ECHO: "Testing matrix * vector: [3, 2, 13]" +ECHO: " Bounds check: undef" +ECHO: "Testing vector * matrix: [9, 8]" +ECHO: " Bounds check: undef" +ECHO: "Testing id matrix * id matrix: [[1, 0], [0, 1]]" +ECHO: "Testing asymmetric matrix * matrix: [[2, 1], [-1, 0]]" +ECHO: "Testing alternate asymmetric matrix * matrix: [[1, 0, 1], [0, 1, -1], [1, 1, 0]]" +ECHO: " Bounds check: undef" diff --git a/tests/regression/echotest/vector-values-expected.txt b/tests/regression/echotest/vector-values-expected.txt deleted file mode 100644 index 78053b9..0000000 --- a/tests/regression/echotest/vector-values-expected.txt +++ /dev/null @@ -1,10 +0,0 @@ -ECHO: "Testing vector dot product: 14" -ECHO: " Bounds check: undef" -ECHO: "Testing matrix * vector: [3, 2, 13]" -ECHO: " Bounds check: undef" -ECHO: "Testing vector * matrix: [9, 8]" -ECHO: " Bounds check: undef" -ECHO: "Testing id matrix * id matrix: [[1, 0], [0, 1]]" -ECHO: "Testing asymmetric matrix * matrix: [[2, 1], [-1, 0]]" -ECHO: "Testing alternate asymmetric matrix * matrix: [[1, 0, 1], [0, 1, -1], [1, 1, 0]]" -ECHO: " Bounds check: undef" -- cgit v0.10.1 From 8c11a091d57b684bdb1a4f652c9534dd2b6104ba Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 21 Sep 2013 10:25:36 -0500 Subject: use debug symbols for test binaries. also remove echostream pointer diff --git a/src/openscad.cc b/src/openscad.cc index 82afc16..49ec31c 100644 --- a/src/openscad.cc +++ b/src/openscad.cc @@ -86,14 +86,16 @@ using boost::is_any_of; class Echostream : public std::ofstream { public: - Echostream( const char * filename ) : std::ofstream( filename ) - { + Echostream( const char * filename ) : std::ofstream( filename ) { set_output_handler( &Echostream::output, this ); } static void output( const std::string &msg, void *userdata ) { Echostream *thisp = static_cast(userdata); *thisp << msg << "\n"; } + ~Echostream() { + this->close(); + } }; static void help(const char *progname) @@ -189,7 +191,7 @@ Camera get_camera( po::variables_map vm ) return camera; } -int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *output_file, fs::path original_path, Render::type renderer, char ** argv, bool echo ) +int cmdline( const char* deps_output_file, const char* filename, Camera &camera, const char *output_file, fs::path original_path, Render::type renderer, char ** argv ) { parser_init(boosty::stringy(boost::filesystem::path( argv[0] ).parent_path())); Tree tree; @@ -228,9 +230,9 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, #if 0 && DEBUG top_ctx.dump(NULL, NULL); #endif - - Echostream *echostream; - if (echo_output_file) echostream = new Echostream( echo_output_file ); + shared_ptr echostream; + if (echo_output_file) + echostream.reset( new Echostream( echo_output_file ) ); FileModule *root_module; ModuleInstantiation root_inst("group"); @@ -270,8 +272,6 @@ int cmdline( const char* deps_output_file, const char* filename, Camera &camera, tree.setRoot(root_node); - if (echostream) echostream->close(); - if (csg_output_file) { fs::current_path(original_path); std::ofstream fstream(csg_output_file); diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 61a3520..1c9eb9a 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -40,8 +40,8 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}") # Build debug build as default if(NOT CMAKE_BUILD_TYPE) -# set(CMAKE_BUILD_TYPE RelWithDebInfo) - set(CMAKE_BUILD_TYPE Release) + set(CMAKE_BUILD_TYPE RelWithDebInfo) +# set(CMAKE_BUILD_TYPE Release) endif() if(CMAKE_COMPILER_IS_GNUCXX) @@ -898,7 +898,7 @@ add_cmdline_test(csgtermtest EXE ${OPENSCAD_BINPATH} ARGS -o SUFFIX term FILES ${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 dump SUFFIX csg FILES ${DUMPTEST_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}) -- cgit v0.10.1 From c6600f88414690f02251c0751b15a33ec0a8b553 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sat, 21 Sep 2013 10:35:36 -0500 Subject: dumptest should be fine now on BSD, using openscad binary diff --git a/doc/testing.txt b/doc/testing.txt index 5617e61..ee560a5 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -69,10 +69,9 @@ This is almost the same as adding a new regression test: Migration away from dedicated regression tests: ----------------------------------------------- -Two tests still need an intermediate script that mangles away timestamps and +This test still needs an intermediate script that mangles away timestamps and near-zero floating point numbers: -* dumptest * cgalstlsanitytest Some tests are yet to be converted: -- cgit v0.10.1 From 4ebd8136a83325e67be7a39c9349ec8812aa05c1 Mon Sep 17 00:00:00 2001 From: Don Bright Date: Sun, 22 Sep 2013 05:30:41 -0500 Subject: enable clang for freebsd (tested on freebsd 9) diff --git a/libraries/MCAD b/libraries/MCAD index 9a958fd..1cc850b 160000 --- a/libraries/MCAD +++ b/libraries/MCAD @@ -1 +1 @@ -Subproject commit 9a958fd11b0a6b5f8becd37c4f8a42f585abfcd8 +Subproject commit 1cc850b44914e1863adfaea2d6f9c848bbc514ea diff --git a/scripts/setenv-unibuild.sh b/scripts/setenv-unibuild.sh index d5ccb75..cfcf23d 100644 --- a/scripts/setenv-unibuild.sh +++ b/scripts/setenv-unibuild.sh @@ -43,9 +43,15 @@ setenv_common() setenv_freebsd() { + echo .... freebsd detected. + echo .... if you have freebsd >9, it is advisable to install + echo .... the clang compiler and re-run this script as + echo .... '. ./scripts/setenv-unibuild.sh clang' setenv_common QMAKESPEC=freebsd-g++ QTDIR=/usr/local/share/qt4 + export QMAKESPEC + export QTDIR } setenv_netbsd() @@ -78,6 +84,17 @@ setenv_linux_clang() echo QMAKESPEC has been modified: $QMAKESPEC } +setenv_freebsd_clang() +{ + export CC=clang + export CXX=clang++ + export QMAKESPEC=freebsd-clang + + echo CC has been modified: $CC + echo CXX has been modified: $CXX + echo QMAKESPEC has been modified: $QMAKESPEC +} + setenv_netbsd_clang() { echo --------------------- this is not yet supported. netbsd 6 lacks @@ -141,6 +158,9 @@ if [ "`uname | grep -i 'linux\|debian'`" ]; then fi elif [ "`uname | grep -i freebsd`" ]; then setenv_freebsd + if [ "`echo $* | grep clang`" ]; then + setenv_freebsd_clang + fi elif [ "`uname | grep -i netbsd`" ]; then setenv_netbsd if [ "`echo $* | grep clang`" ]; then -- cgit v0.10.1