Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge remote-tracking branch 'upstream/master' into fonts_search_example

  • Loading branch information...
commit 65c3acf5e66428948b9bcaaff507e962494e3bc1 2 parents bd5aac6 + cf52a2a
@clothbot clothbot authored
View
2  .gitmodules
@@ -1,3 +1,3 @@
[submodule "libraries/MCAD"]
path = libraries/MCAD
- url = git@github.com:openscad/MCAD.git
+ url = ../MCAD.git
View
14 doc/testing.txt
@@ -51,6 +51,20 @@ Adding a new regression test:
7) run the test normally and verify that it passes:
$ ctest -R mytest
+Adding a new example:
+---------------------
+
+This is almost the same as adding a new regression test:
+1) Create the example under examples/
+2) run the test with the environment variable TEST_GENERATE=1, e.g.:
+ $ TEST_GENERATE=1 ctest -C Examples -R exampleNNN
+ (this will generate a exampleNNN-expected.txt file which is used for regression testing)
+3) manually verify that the output is correct (tests/regression/<testapp>/exampleNNN.<suffix>)
+4) run the test normally and verify that it passes:
+ $ ctest -C Examples -R exampleNNN
+
+
+
Troubleshooting:
------------------------------
View
69 scripts/release-macosx.sh
@@ -1,69 +0,0 @@
-##
-## Deprecated! Use release-common.sh instead
-##
-
-#!/bin/sh
-#
-# This script creates a binary release of OpenSCAD for Mac OS X.
-# The script will create a file called openscad-<versionstring>.zip
-# in the current directory.
-#
-# Usage: makedmg.sh [-v <versionstring>]
-# -v Version string (e.g. -v 2010.01)
-#
-# If no version string is given, todays date will be used (YYYY-MM-DD)
-#
-printUsage()
-{
- echo "Usage: $0 -v <versionstring>"
- echo
- echo " Example: $0 -v 2010.01"
-}
-
-while getopts 'v:' c
-do
- case $c in
- v) VERSION=$OPTARG;;
- esac
-done
-
-if test -z "$VERSION"; then
- VERSION=`date "+%Y.%m.%d"`
-fi
-
-echo "Building openscad-$VERSION..."
-export OPENCSGDIR=$PWD/../OpenCSG-1.2.0
-qmake VERSION=$VERSION CONFIG+=mdi openscad.pro
-make clean
-make -j2
-echo "Preparing executable.."
-mkdir OpenSCAD.app/Contents/Frameworks
-cp $OPENCSGDIR/lib/libopencsg.dylib OpenSCAD.app/Contents/Frameworks
-cp /opt/local/lib/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks
-cp /Library/Frameworks/QtOpenGL.framework/Versions/4/QtOpenGL OpenSCAD.app/Contents/Frameworks
-cp /Library/Frameworks/QtGui.framework/Versions/4/QtGui OpenSCAD.app/Contents/Frameworks
-cp /Library/Frameworks/QtCore.framework/Versions/4/QtCore OpenSCAD.app/Contents/Frameworks
-install_name_tool -change libopencsg.1.dylib @executable_path/../Frameworks/libopencsg.dylib OpenSCAD.app/Contents/MacOS/openscad
-install_name_tool -change QtOpenGL.framework/Versions/4/QtOpenGL @executable_path/../Frameworks/QtOpenGL OpenSCAD.app/Contents/MacOS/openscad
-install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/MacOS/openscad
-install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/MacOS/openscad
-install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/QtOpenGL
-install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtOpenGL
-install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/QtGui
-install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/MacOS/openscad
-install_name_tool -id libopencsg.dylib OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
-install_name_tool -change /opt/local/lib/libGLEW.1.5.1.dylib @executable_path/../Frameworks/libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
-install_name_tool -change QtGui.framework/Versions/4/QtGui @executable_path/../Frameworks/QtGui OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
-install_name_tool -change QtCore.framework/Versions/4/QtCore @executable_path/../Frameworks/QtCore OpenSCAD.app/Contents/Frameworks/libopencsg.dylib
-install_name_tool -id libGLEW.1.5.1.dylib OpenSCAD.app/Contents/Frameworks/libGLEW.1.5.1.dylib
-
-echo "Creating directory structure.."
-rm -rf openscad-$VERSION
-mkdir -p openscad-$VERSION/examples
-cp examples/* openscad-$VERSION/examples/
-chmod -R 644 openscad-$VERSION/examples/*
-mv OpenSCAD.app openscad-$VERSION
-
-echo "Creating archive.."
-zip -qr openscad-$VERSION.zip openscad-$VERSION
-echo "Mac OS X binary created: openscad-$VERSION.zip"
View
4 src/value.cc
@@ -426,6 +426,10 @@ std::string Value::toString() const
// Quick and dirty hack to work around floating point rounding differences
// across platforms for testing purposes.
{
+ if (this->num != this->num) { // Fix for avoiding nan vs. -nan across platforms
+ stream << "nan";
+ break;
+ }
std::stringstream tmp;
tmp.precision(12);
tmp.setf(std::ios_base::fixed);
View
32 tests/CMakeLists.txt
@@ -229,10 +229,27 @@ 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})
+ find_path(GLEW_INCLUDE_DIR
+ GL/glew.h
+ HINTS ${GLEW_DIR}/include
+ NO_DEFAULT_PATH)
+ find_library(GLEW_LIBRARY
+ NAMES GLEW glew
+ HINTS ${GLEW_DIR}/lib
+ NO_DEFAULT_PATH)
+ if (NOT GLEW_LIBRARY)
+ find_package(GLEW REQUIRED)
+ if (NOT GLEW_LIBRARY)
+ message(FATAL_ERROR "GLEW not found")
+ endif()
+ endif()
+ message(STATUS "GLEW include: " ${GLEW_INCLUDE_DIR})
+ message(STATUS "GLEW library: " ${GLEW_LIBRARY})
+endif()
-find_package(GLEW REQUIRED)
-
-inclusion( GLEW_DIR GLEW_INCLUDE_PATH )
+inclusion(GLEW_DIR GLEW_INCLUDE_DIR)
# Flex/Bison
find_package(BISON REQUIRED)
@@ -401,25 +418,25 @@ target_link_libraries(echotest tests-nocgal tests-core ${QT_LIBRARIES} ${OPENGL_
# dumptest
#
add_executable(dumptest dumptest.cc)
-target_link_libraries(dumptest tests-common tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
+target_link_libraries(dumptest tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
#
# modulecachetest
#
add_executable(modulecachetest modulecachetest.cc)
-target_link_libraries(modulecachetest tests-common tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
+target_link_libraries(modulecachetest tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
#
# csgtexttest
#
add_executable(csgtexttest csgtexttest.cc CSGTextRenderer.cc CSGTextCache.cc)
-target_link_libraries(csgtexttest tests-common tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
+target_link_libraries(csgtexttest tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
#
# csgtermtest
#
add_executable(csgtermtest csgtermtest.cc ../src/CSGTermEvaluator.cc)
-target_link_libraries(csgtermtest tests-common tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
+target_link_libraries(csgtermtest tests-nocgal ${QT_LIBRARIES} ${OPENGL_LIBRARY} ${Boost_LIBRARIES})
#
# cgaltest
@@ -640,6 +657,7 @@ disable_tests(dumptest_transform-tests
dumptest_render-tests
dumptest_difference-tests
dumptest_intersection-tests
+ dumptest_text-search-test
dumptest_example001
dumptest_example005
dumptest_example006
View
94 tests/FindGLEW.cmake
@@ -3,55 +3,63 @@
# Once done this will define
#
# GLEW_FOUND
-# GLEW_INCLUDE_PATH
+# GLEW_INCLUDE_DIR
# GLEW_LIBRARY
#
# 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.5)
+endif()
-IF (WIN32)
- FIND_PATH( GLEW_INCLUDE_PATH 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)
- message(STATUS "GLEW_DIR: " ${GLEW_DIR})
- FIND_PATH( GLEW_INCLUDE_PATH GL/glew.h
- HINTS ${GLEW_DIR}/include
- 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
- HINTS ${GLEW_DIR}/lib
- PATHS /usr/lib /usr/local/lib /usr/pkg/lib
- NO_DEFAULT_PATH
- DOC "The GLEW library")
-ENDIF (WIN32)
+if (GLEW_LIBRARIES)
+ set(GLEW_INCLUDE_DIR "${GLEW_INCLUDE_DIRS}")
+ set(GLEW_LIBRARY ${GLEW_LDFLAGS})
+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 (GLEW_INCLUDE_PATH)
- SET( GLEW_FOUND 1 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
- MESSAGE(STATUS "GLEW include found in " ${GLEW_INCLUDE_PATH} )
- MESSAGE(STATUS "GLEW library found in " ${GLEW_LIBRARY} )
-ELSE (GLEW_INCLUDE_PATH)
- SET( GLEW_FOUND 0 CACHE STRING "Set to 1 if GLEW is found, 0 otherwise")
-ENDIF (GLEW_INCLUDE_PATH)
+ 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)
+
+ 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")
+ endif()
+endif()
Please sign in to comment.
Something went wrong with that request. Please try again.