diff --git a/.circleci/config.yml b/.circleci/config.yml index 6ef0afaa47..09ce37af35 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -12,12 +12,13 @@ jobs: no_output_timeout: 18000 command: | export NUMCPU=4 + export LC_ALL=C.UTF-8 export MXEDIR=/mxe export LIB3MF_INCLUDEDIR=/mxe/usr/i686-w64-mingw32.static.posix/include/lib3mf export LIB3MF_LIBDIR=/mxe/usr/i686-w64-mingw32.static.posix/lib if [ x"${CIRCLE_BRANCH}" = xmaster ]; then export SUFFIX=""; else export SUFFIX="_$(echo ${CIRCLE_BRANCH} | sed -e 's,pull/,PR,')"; fi export OPENSCAD_VERSION="$(date +%Y.%m.%d).ci${CIRCLE_BUILD_NUM}" - ./scripts/release-common.sh -snapshot -mingw32 -v "$OPENSCAD_VERSION" + ./scripts/release-common.sh snapshot mingw32 -v "$OPENSCAD_VERSION" mkdir -p /tmp/out for f in mingw*/*.zip mingw*/*.exe; do N=$(basename "$f" | sed -e "s/\\(-x86-[36][24]\\)/\\1${SUFFIX}/;"); cp -iv "$f" /tmp/out/"$N"; done if [ -n "${CODE_SIGNING_KEY}" ]; then @@ -44,13 +45,14 @@ jobs: no_output_timeout: 18000 command: | export NUMCPU=4 + export LC_ALL=C.UTF-8 export MXEDIR=/mxe export LIB3MF_INCLUDEDIR=/mxe/usr/x86_64-w64-mingw32.static.posix/include/lib3mf export LIB3MF_LIBDIR=/mxe/usr/x86_64-w64-mingw32.static.posix/lib if [ x"${CIRCLE_BRANCH}" = xmaster ]; then export SUFFIX=""; else export SUFFIX="_$(echo ${CIRCLE_BRANCH} | sed -e 's,pull/,PR,')"; fi export OPENSCAD_VERSION="$(date +%Y.%m.%d).ci${CIRCLE_BUILD_NUM}" - ./scripts/release-common.sh -snapshot -mingw64 -v "$OPENSCAD_VERSION" + ./scripts/release-common.sh snapshot mingw64 -v "$OPENSCAD_VERSION" mkdir -p /tmp/out for f in mingw*/*.zip mingw*/*.exe; do N=$(basename "$f" | sed -e "s/\\(-x86-[36][24]\\)/\\1${SUFFIX}/;"); cp -iv "$f" /tmp/out/"$N"; done if [ -n "${CODE_SIGNING_KEY}" ]; then diff --git a/.github/workflows/macos-tests.yml b/.github/workflows/macos-tests.yml index 54e5ec6e40..185086a640 100644 --- a/.github/workflows/macos-tests.yml +++ b/.github/workflows/macos-tests.yml @@ -31,7 +31,7 @@ jobs: run: | cd build/tests export NUMCPU=$(($(sysctl -n hw.ncpu) * 3 / 2)) - ctest -j$NUMCPU -E 'edges_view-options-tests|nef3_broken' + ctest -j$NUMCPU - name: Upload Test Result Report uses: actions/upload-artifact@v3 if: ${{ always() }} diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 4dd180db6d..1537003090 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -41,7 +41,7 @@ jobs: run: | cd build cd tests - ctest -j2 -E 'opencsgtest_issue1165|opencsgtest_issue1215|throwntogethertest_issue1089|throwntogethertest_issue1215|openscad-nonascii|import_3mf|3mfpngtest|3mfexport|pdfexporttest_centered' + ctest -j2 - name: Upload Test Result Report uses: actions/upload-artifact@v3 if: ${{ always() }} diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 760a2d45bb..0000000000 --- a/.travis.yml +++ /dev/null @@ -1,153 +0,0 @@ -language: cpp - -matrix: - include: - - os: linux - sudo: required - compiler: gcc - dist: xenial - env: - - DIST="Ubuntu 16.04 (Xenial)" - - PARALLEL=-j2 - - PARALLEL_CTEST=-j4 - - ENV_SPECIFIC_DISABLE="|nef3_broken" - before_install: - # Fix for "write error" build failures ( https://github.com/travis-ci/travis-ci/issues/8920 ) - - python -c "import fcntl; fcntl.fcntl(1, fcntl.F_SETFL, 0)" - - ./scripts/travis-ci-before-install-linux.sh "$TRAVIS_DIST" - cache: - - apt - - ccache - - if: NOT branch = coverity_scan - os: linux - sudo: required - compiler: gcc - dist: bionic - env: - - DIST="Ubuntu 18.04 (Bionic)" - - PARALLEL=-j2 - - PARALLEL_CTEST=-j4 - - ENV_SPECIFIC_DISABLE="|nef3_broken" - before_install: - - ./scripts/travis-ci-before-install-linux.sh "$TRAVIS_DIST" - cache: - - apt - - ccache - - if: NOT branch = coverity_scan - os: linux - sudo: required - compiler: gcc - dist: focal - env: - - DIST="Ubuntu 20.04 (Focal)" - - PARALLEL=-j2 - - PARALLEL_CTEST=-j4 - - ENV_SPECIFIC_DISABLE="|nef3_broken" - before_install: - - ./scripts/travis-ci-before-install-linux.sh "$TRAVIS_DIST" - cache: - - apt - - ccache - - if: branch = macos-dummy -# - if: NOT branch = coverity_scan - os: osx - osx_image: xcode12.2 - compiler: clang - env: - - PARALLEL=-j2 - - PARALLEL_CTEST=-j4 - - HOMEBREW_NO_AUTO_UPDATE=1 - - ENV_SPECIFIC_DISABLE="|edges_view-options-tests|nef3_broken" - before_install: - - test -d /usr/local/opt/opencsg/lib || { rmdir /usr/local/opt/opencsg; brew install opencsg; } - - test -d /usr/local/opt/libzip/lib || { rmdir /usr/local/opt/libzip; brew install libzip; } - # prevent automatic upgrade to openjdk - - brew cask uninstall --force java - # prevent upgrades of non-critical packages that take long time - - brew pin node postgresql postgis ansible imagemagick - - ./scripts/macosx-build-homebrew.sh - before_cache: - - brew cleanup - cache: - - ccache - - directories: - - $HOME/Library/Caches/Homebrew - - /usr/local/Cellar/opencsg - - /usr/local/opt/opencsg - - /usr/local/Cellar/libzip - - /usr/local/opt/libzip - -notifications: - irc: - channels: - - "chat.freenode.net#openscad" - on_success: change - use_notice: false - -branches: - only: - - master - - coverity_scan - -before_script: - - echo -e "Host files.openscad.org\n\tStrictHostKeyChecking no\n" >> ~/.ssh/config - - for i in {0..40}; do eval $(printf "echo \$openscad_rsa_%02d\n" $i) >> ~/.ssh/openscad_rsa_base64; done - - base64 --decode ~/.ssh/openscad_rsa_base64 > ~/.ssh/id_rsa - - chmod 600 ~/.ssh/id_rsa - -script: if [ "${COVERITY_SCAN_BRANCH}" = 1 ]; then ./scripts/coverity.sh ; else ./scripts/travis-ci.sh ; fi - -env: - global: - - QT_SELECT=qt5 - - OPENSCAD_UPLOAD_TESTS=yes - - secure: "mBWdnkXe8BL1SqYRBnOOpXn60xtHGfpeVOh+HrK8xZPflLyJLdgAz3jsrgPaaMibfuygOEfn86jm8dFZPDJSeGh+gGbcjbtOywvYtr0d/KJPk2ccCavlGEBsTSdfWVBMH2hqZ+OXrSn4amx12fmcF/rnpRZu0jHxRWrL4SbouXM=" - - secure: "gYPUvQekTxYW4bNIDvL6MFdPihd0HFGIq2saEbcOVyGYuZTdyBIzoh3tLIdG6jJNLWb/Nn2iWEsbsSsSIVk9UowW2qmuKVmzOyezKiu7wO2bdk08zeNtZLdFU4f8NsPz/ODXGQBCbjrBr8csnczQ9DKcxQeG2Lr9z1PjpJE43zY=" - - secure: "N4tu1zJPq4tDrfArXawiQZ/oAb3jZ1xEonxH2WWMnUXj6CGMSrRbkUD7h7Yx5WcIgxkDE87Q+mMgKDNDhDQuK4RiTngwokXKSCHYn0odo10o1SWiNE42czLpbCTWJeM/5m+nyPhE1Hn8StTwiwqiA2YkBUICh/z+s6cmqV5JaEU=" - - secure: "hfkGLUH90vkYIIQlBjAlYRxl/KJE/d5Z8cGnXGN77+RuvmGN2vMspSTXdvIe7KXesLs3ly96iA/mx3LLzW4YQu1qlwaAtffXiX2GBUFgRAHQV4Ty6PJzwRjzTxqZTh2jE+lZukB/6oh0ZlF4lpFYRFIMwLQMP64gGN0aqdQwc0I=" - - secure: "UBH3ATAhykSH4su70oG6vmnOfV62ghNDLO/Y5dZwZvZVkKdERdddtpP8tPmJrkeqZp6nZs2DPA1ufgifaShZgv5eo5U1pdg4zFRA8UuOlK51QWdPYdk4/kTbifqeKhiQlNpvMXGnRPfk0a2HdAiaAHk0FKIPBRPAgwJlE03zKf4=" - - secure: "YAMu566rDdaAHflMlvBdwkb7F4DNoDa6nJ1/d0bbaPDDk2onxzt5Nos9P3LMMya9XDo/+/8XZWUhdU2t8fwKfKiAanaIPiDYFaS7gZDohu7TI41rqJnnHFF1KNtG624PbABIgKBu8AEHsF1op7EG31SD8ZFyYTBdFOlgVruNWEA=" - - secure: "cLVNa1aAtGyO7nHumphZRcNmMnFp+Ts4Bqh6WlclZ3RljEp5rKqHP3knHVgE6T0jC6zMTdNDwKHkyW2jlETRa0l7SGblZI1iuAATnNMwH14FPJgfHP2g30dYu714J6ik6UWUyFNex6o5ZlrVnTnrTuQpTQmF/Ehb4xBcFh780S8=" - - secure: "VXa5G1ow1YND0Ap7jTH6oewSlgE3bQz0ZRKPz/bMEQhmImitAW24LG+kLi1RWfvtwJdHBOExlwh/yGpe508WXLF5F/Hv9LKTeAFixUSpFXt1Llsx1/LuApy7i4bq9nmx30Of5GiFvUARTr0wa1a3BbH5E0Sj963vVLwy+FZDiS8=" - - secure: "K9pzYAsFc9rvFVz12Y80uFpruH7R5tJpurtGxQJpgSRCr4kRlJO+ODt4/Voq7lzFCiMuhbBiE0G4f8SzylyyiyJaZshAxqRBteEdDEMEnx1ND4FbqDnB9apWnWRoY1AbqBx1ckEy3jCvw1Tn9bRvvvcnOI6qXFxLpTJMP3eY6R4=" - - secure: "Oa/blQENesTANzJbqzdQPQ1Hg99DaUVCekms1xkymLBUCSzqPL44KVdz3cxVGYBl/Om7mBwENEQ9BOUI6vGq+CZ7aaTYrYfEUokgvhGUgku0iLjxpHrIH04TH4XwpDXRg/iLwdQZO3d+xq7Q4XTBLOEyHVdzn5uDGP+cNoW9NbM=" - - secure: "L3vKi+0gahSm8DF2GGp98FPhuWtUlqRRpCXjAUsSVNCPtru01tI4i6Kls7yqq2L+31FtkyWqBIlm1S1OZw8uiPyis3eUDqMRgASs4tOx/q2Xj2TEK8p+TKK+d3A8mct/y0e806GwdH5JIIppGSPOknPtxT92jZMrv0PnGnPAJSQ=" - - secure: "fZzEs4GUtK494s63as9K72kmw0taicfouk2NDym58wHqS88UeRVjvrAkwoIGLJS6rCrh/4NkKhxPkd6JNVRVHy3KH8j2FYoIwtLStEC7YZfT25gi8EiN+O6MrTVre1WA9RT52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nEGWaf17ln4dqi3KHXWU7h2Gdg1ah19NS0nWytooW6VcEXmk+cYSheTqyfc5gK7Sdo=" - - secure: "mMc9MyopIjvzpDg3eN6owSmr2PI58JiPnlLhMNvOWW9axUzup5tthfqM+tvR/AqdLQSSMUC9JXwwQK0d543Q4YyoQ0jwVY2RT56VdEywxD5+yWRfXD+ANlJhdQWmlPVc3KsavKYmfQPBLbwe0nyhtQTWGeAgKTYvYT+k1/PD4rg=" - - secure: "X7KDSiSOR3XcePJgTXNzwE1wU285yFsxB7crMLskD08wU8xdRqS8NL+1++/Lju6pypOkospI2AYH1JAJ7JK3Sx5QYM4MxgRJcrMHiTMirN3cm3KzkWUuv3iEZNJ7q6ANi5oFfHh3k0D4JhCEnA1ICTDPdq+r9+mOvgkrly8V0Dw=" - # scan.coverity token - - secure: "CGHkiv3Aki3HF2xiNPbPEqB66Xcz8HrdhSpFYjQFqHsrseIXOmZGLaIdnkwCqoIHUMFVtqGVGSxRhhrSOrAq+uOgc6Wyst8u6ThN3HhRbvQgF2v7XvtGsTiAObxLvj5V91gqQwHxWPHf948Cm12QQgmEd+dbhyjPWsmVMDb4gNk=" - -addons: - coverity_scan: - project: - name: "openscad/openscad" - description: "The Programmers Solid 3D CAD Modeller" - notification_email: dev@openscad.org - build_command_prepend: qmake CONFIG-=debug CONFIG+=experimental CONFIG+=snapshot - build_command: make - branch_pattern: coverity_scan diff --git a/CMakeLists.txt b/CMakeLists.txt index e2a7b34887..d1620ab1ce 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -26,7 +26,11 @@ endif() set(CMAKE_OSX_DEPLOYMENT_TARGET "10.13" CACHE STRING "Minimum OS X deployment version") include("cmake/Modules/openscad_version.cmake") -project(openscad LANGUAGES C CXX) +project(OpenSCAD + VERSION ${PROJECT_VERSION} + DESCRIPTION "The Programmer's Solid 3D CAD Modeler" + LANGUAGES C CXX +) option(INFO "Display build configuration info at end of cmake config" ON) option(ENABLE_TESTS "Run testsuite after building." ON) @@ -84,8 +88,9 @@ set_property(TARGET OpenSCAD PROPERTY CXX_STANDARD_REQUIRED ON) set_property(TARGET OpenSCAD PROPERTY EXPORT_COMPILE_COMMANDS ON) set_property(TARGET OpenSCAD PROPERTY LINKER_LANGUAGE CXX) # Verbose link step -if(CMAKE_CXX_COMPILER_ID MATCHES "AppleClang|Clang|GNU") - set_property(TARGET OpenSCAD PROPERTY LINK_FLAGS -v) +if(("${CMAKE_CXX_COMPILER_FRONTEND_VARIANT}" STREQUAL "GNU") OR + ("${CMAKE_CXX_COMPILER_ID}" MATCHES "AppleClang|Clang|GNU")) + target_link_options(OpenSCAD BEFORE PRIVATE "-v") endif() set(SUFFIX "" CACHE STRING "Installation suffix for binary (e.g. 'nightly')") @@ -907,31 +912,82 @@ configure_file(${RESOURCE_DIR}/icons/openscad.desktop.in ${RESOURCE_DIR}/icons/o configure_file(${RESOURCE_DIR}/common.qrc.in ${RESOURCE_DIR}/common.qrc) configure_file(${RESOURCE_DIR}/mac.qrc.in ${RESOURCE_DIR}/mac.qrc) -if(NOT APPLE OR APPLE_UNIX) -set_target_properties(OpenSCAD PROPERTIES OUTPUT_NAME openscad${SUFFIX_WITH_DASH}) -install(TARGETS OpenSCAD RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}) -install(FILES ${CMAKE_CURRENT_LIST_DIR}/doc/openscad.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME openscad${SUFFIX_WITH_DASH}.1) -install(FILES ${CMAKE_CURRENT_LIST_DIR}/openscad.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo RENAME org.openscad.OpenSCAD${SUFFIX_WITH_DASH}.appdata.xml) -install(FILES ${RESOURCE_DIR}/icons/openscad.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications RENAME openscad${SUFFIX_WITH_DASH}.desktop) -install(FILES ${RESOURCE_DIR}/icons/openscad.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages RENAME openscad${SUFFIX_WITH_DASH}.xml) -install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-48.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps RENAME openscad${SUFFIX_WITH_DASH}.png) -install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-64.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps RENAME openscad${SUFFIX_WITH_DASH}.png) -install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-128.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps RENAME openscad${SUFFIX_WITH_DASH}.png) -install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-256.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps RENAME openscad${SUFFIX_WITH_DASH}.png) -install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-512.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps RENAME openscad${SUFFIX_WITH_DASH}.png) -install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/color-schemes DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH}) -install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/examples DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH}) -install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/fonts DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH} PATTERN ".uuid" EXCLUDE) -install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/libraries DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH} PATTERN ".git*" EXCLUDE) -install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/locale DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH} FILES_MATCHING PATTERN "*/LC_MESSAGES/openscad.mo") -install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/shaders DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH}) -install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/templates DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH} FILES_MATCHING PATTERN "*.json") +# Installation +if(WIN32) + set(OPENSCAD_BINDIR ".") + set(OPENSCAD_INSTALL_RESOURCEDIR ".") +else() + set(OPENSCAD_BINDIR ${CMAKE_INSTALL_BINDIR}) + set(OPENSCAD_INSTALL_RESOURCEDIR ${CMAKE_INSTALL_DATAROOTDIR}/openscad${SUFFIX_WITH_DASH}) endif() -if(INFO) - include(info) +if(NOT APPLE OR APPLE_UNIX) + set_target_properties(OpenSCAD PROPERTIES OUTPUT_NAME openscad${SUFFIX_WITH_DASH}) + install(TARGETS OpenSCAD RUNTIME DESTINATION "${OPENSCAD_BINDIR}") + if(WIN32) + if(USE_MIMALLOC AND MI_LINK_SHARED) + if(CMAKE_SIZEOF_VOID_P EQUAL 8) + install(FILES ${CMAKE_SOURCE_DIR}/submodules/mimalloc/bin/mimalloc-redirect.dll DESTINATION ".") + elseif(CMAKE_SIZEOF_VOID_P EQUAL 4) + install(FILES ${CMAKE_SOURCE_DIR}/submodules/mimalloc/bin/mimalloc-redirect32.dll DESTINATION ".") + endif() + install(FILES ${CMAKE_BINARY_DIR}/submodules/mimalloc/mimalloc.dll DESTINATION ".") + endif() + else() + install(FILES ${CMAKE_CURRENT_LIST_DIR}/doc/openscad.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1 RENAME openscad${SUFFIX_WITH_DASH}.1) + install(FILES ${CMAKE_CURRENT_LIST_DIR}/openscad.appdata.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/metainfo RENAME org.openscad.OpenSCAD${SUFFIX_WITH_DASH}.appdata.xml) + install(FILES ${RESOURCE_DIR}/icons/openscad.desktop DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/applications RENAME openscad${SUFFIX_WITH_DASH}.desktop) + install(FILES ${RESOURCE_DIR}/icons/openscad.xml DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/mime/packages RENAME openscad${SUFFIX_WITH_DASH}.xml) + install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-48.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/48x48/apps RENAME openscad${SUFFIX_WITH_DASH}.png) + install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-64.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/64x64/apps RENAME openscad${SUFFIX_WITH_DASH}.png) + install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-128.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/128x128/apps RENAME openscad${SUFFIX_WITH_DASH}.png) + install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-256.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/256x256/apps RENAME openscad${SUFFIX_WITH_DASH}.png) + install(FILES ${RESOURCE_DIR}/icons/openscad${SUFFIX_WITH_DASH}-512.png DESTINATION ${CMAKE_INSTALL_DATAROOTDIR}/icons/hicolor/512x512/apps RENAME openscad${SUFFIX_WITH_DASH}.png) + endif() + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/color-schemes DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}") + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/examples DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}") + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/fonts DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}" PATTERN ".uuid" EXCLUDE) + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/libraries DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}" PATTERN ".git*" EXCLUDE) + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/locale DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}" FILES_MATCHING PATTERN "*/LC_MESSAGES/openscad.mo") + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/shaders DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}") + install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/templates DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}" FILES_MATCHING PATTERN "*.json") endif() +# Packaging: CPACK_* settings should be configured before `include(CPack)` +include(InstallRequiredSystemLibraries) +set(CPACK_PACKAGE_NAME OpenSCAD) +set(CPACK_PACKAGE_VERSION ${OPENSCAD_VERSION}) +set(CPACK_PACKAGE_DESCRIPTION_SUMMARY "The Programmer's Solid 3D CAD Modeler") + +if(MXECROSS) + set(CPACK_GENERATOR ZIP;NSIS) + set(CPACK_SYSTEM_NAME ${PACKAGE_ARCH}) + if("${CMAKE_VERSION}" VERSION_GREATER_EQUAL "3.22") + set(CPACK_NSIS_IGNORE_LICENSE_PAGE ON) + else() + message(FATAL_ERROR "CPACK_NSIS_IGNORE_LICENSE_PAGE requires cmake 3.22") + endif() + set(CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS "\ + !include \\\"FileFunc.nsh\\\"\n\ + !include \\\"${CMAKE_SOURCE_DIR}/scripts/mingw-file-association.nsh\\\"\ + ") + set(CPACK_NSIS_EXTRA_INSTALL_COMMANDS "\ + \\\${RegisterExtension} '$INSTDIR\\\\openscad.exe' '.scad' 'OpenSCAD_File'\n\ + \\\${RefreshShellIcons}\ + ") + set(CPACK_NSIS_EXTRA_UNINSTALL_COMMANDS "\ + \\\${UnRegisterExtension} '.scad' 'OpenSCAD_File'\n\ + \\\${RefreshShellIcons}\ + ") +endif() +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING") +# None of config time variables are available for CPACK_PROJECT_CONFIG_FILE, so we configure it now with values. +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/openscad_cpack.cmake.in" + "${CMAKE_BINARY_DIR}/openscad_cpack.cmake" @ONLY) +# CPACK_PROJECT_CONFIG_FILE is for configuring CPack-generator specific settings +set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_BINARY_DIR}/openscad_cpack.cmake") +set(CPACK_THREADS 0) + if(ENABLE_TESTS) add_subdirectory(tests) endif() @@ -939,3 +995,9 @@ endif() if(OFFLINE_DOCS) add_subdirectory(resources) endif() + +include(CPack) + +if(INFO) + include("cmake/Modules/info.cmake") +endif() diff --git a/cmake/Modules/FindLib3MF.cmake b/cmake/Modules/FindLib3MF.cmake index b1e46e19f7..5772ce3a2a 100644 --- a/cmake/Modules/FindLib3MF.cmake +++ b/cmake/Modules/FindLib3MF.cmake @@ -7,7 +7,7 @@ # LIB3MF_LIBDIR # LIB3MF_INCLUDE_DIRS # LIB3MF_LIBRARIES -# +# # Don't specify REQUIRED here in case pkg-config fails. # We still fall back to the rest of detection code here. @@ -33,7 +33,7 @@ find_path(LIB3MF_INCLUDE_DIRS HINTS $ENV{LIB3MF_INCLUDEDIR} ${PC_LIB3MF_INCLUDEDIR} ${PC_LIB3MF_INCLUDE_DIRS} - PATH_SUFFIXES lib3mf + PATH_SUFFIXES lib3mf Bindings/Cpp ) find_library(LIB3MF_LIBRARIES diff --git a/cmake/Modules/info.cmake b/cmake/Modules/info.cmake index 563e8a60e4..b1180f6714 100644 --- a/cmake/Modules/info.cmake +++ b/cmake/Modules/info.cmake @@ -1,4 +1,5 @@ get_target_property(DEFINES OpenSCAD COMPILE_DEFINITIONS) +get_target_property(LINK_OPTS OpenSCAD LINK_OPTIONS) message(STATUS " ") message(STATUS "====================================") @@ -53,4 +54,5 @@ else() endif() message(STATUS " ") message(STATUS "DEFINES = ${DEFINES}") +message(STATUS "LINK OPTIONS = ${LINK_OPTS}") message(STATUS " ") diff --git a/cmake/Modules/openscad_cpack.cmake.in b/cmake/Modules/openscad_cpack.cmake.in new file mode 100644 index 0000000000..e41235cce7 --- /dev/null +++ b/cmake/Modules/openscad_cpack.cmake.in @@ -0,0 +1,15 @@ +# CPack-time project CPack configuration file. +# This file is included at cpack time, once per generator +# after CPack has set CPACK_GENERATOR to the actual generator being used. +# It allows per-generator setting of CPACK_* variables at cpack time. + +if(CPACK_GENERATOR MATCHES "NSIS") + set(CPACK_INSTALL_CMAKE_PROJECTS "@CMAKE_BINARY_DIR@;@CMAKE_PROJECT_NAME@;@CMAKE_INSTALL_DEFAULT_COMPONENT_NAME@;/") + set(CPACK_NSIS_COMPONENT_INSTALL 0) + set(CPACK_PACKAGE_INSTALL_DIRECTORY "Openscad@SUFFIX_WITH_DASH@") + set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_FILE_NAME}-Installer") + set(CPACK_NSIS_COMPRESSOR "/SOLID lzma\n\ + SetCompressorDictSize 32") +elseif(CPACK_GENERATOR MATCHES "ARCHIVE") + set(CPACK_INSTALL_CMAKE_PROJECTS "@CMAKE_BINARY_DIR@;@CMAKE_PROJECT_NAME@;ALL;/") +endif() diff --git a/doc/testing.txt b/doc/testing.txt index 66d7bf35dc..0ac1208712 100644 --- a/doc/testing.txt +++ b/doc/testing.txt @@ -5,48 +5,29 @@ Running regression tests: Install the prerequisite helper programs on your system: - cmake, python3 (not 2), ImageMagick 6.5.9.3 or newer, diff + cmake, python3, ImageMagick 6.5.9.3 or newer -There are binary installer packages of these tools available for Mac, -Win, Linux, BSD, and other systems. (except maybe diff for Win) +There are binary installer packages of these tools available for Mac, +Win, Linux, BSD, and other systems. -Next, get a working qmake GUI build of the main openscad binary working. -For Windows(TM) this means get a cross-build working from within linux. -See README.md for how to do this. +A) Building Test environment +Test files will be automatically configured and built (but not ran) as part +of the main openscad build. See README.md for how to get a build of the main +openscad binary working. -Then, install MCAD under openscad/libraries. - -$ cd openscad -$ git submodule update --init - -A) Building test environment - -NOTE: If cmake was used to build openscad itself (as opposed to the qmake build), - then the "cmake" and "make" commands are already automatically run for tests. - Only "cd tests" is needed to begin running ctest in that case. - -Linux, Mac: - - $ cd tests - $ cmake . - $ make - -Windows(TM): - -Cross-build from within linux: - -64-bit: - $ ./scripts/release-common.sh mingw64 tests - $ # result is .zip file under ./mingw64/ - -32-bit: - $ ./scripts/release-common.sh mingw32 tests - $ # result is .zip file under ./mingw32/ +Windows builds are a special case, since they are cross-compiled from a linux +system. The automated build servers package up the tests alongside the binary +if you download a .ZIP Development Snapshot from: http://openscad.org/downloads.html#snapshots +NOTE: **ONLY THE ZIP VERSION** of the download contains the tests. + They would not run properly using an intaller to place under "C:\Program Files" + since that would require elevated priviledges to write the test output files. B) Running tests Linux, Mac: +From your build directory +$ cd tests $ ctest Runs tests enabled by default $ ctest -R Runs only matching tests, e.g. ctest -R dxf $ ctest -C Adds extended tests belonging to configs. diff --git a/scripts/github-ci.sh b/scripts/github-ci.sh index 7b47711e57..6cc731d349 100755 --- a/scripts/github-ci.sh +++ b/scripts/github-ci.sh @@ -31,7 +31,7 @@ do_test() { ( # Use TESTDIR within BUILDDIR cd "$BUILDDIR/$TESTDIR" - ctest $PARALLEL_CTEST -E nef3_broken + ctest $PARALLEL_CTEST if [[ $? != 0 ]]; then exit 1 fi diff --git a/scripts/mingw-x-build-dependencies.sh b/scripts/mingw-x-build-dependencies.sh index 2210be5354..e4c172b6bc 100755 --- a/scripts/mingw-x-build-dependencies.sh +++ b/scripts/mingw-x-build-dependencies.sh @@ -79,23 +79,13 @@ if [ "`git config --get remote.origin.url | grep github.com.openscad`" ]; then echo 'checkout openscad-snapshot-build branch' git checkout openscad-snapshot-build fi -if [ "`echo $* | grep 64`" ]; then - MXE_TARGETS='x86_64-w64-mingw32.static.posix' - if [ "`echo $* | grep download`" ]; then - PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qtbase download-qtmultimedia download-glib download-libxml2 download-freetype download-fontconfig download-harfbuzz download-libzip download-lib3mf download-double-conversion' - else - PACKAGES='qtbase qtmultimedia qscintilla2 mpfr eigen opencsg cgal glib libxml2 freetype fontconfig harfbuzz libzip lib3mf double-conversion' - fi +if [ "`echo $* | grep download`" ]; then +PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qtbase download-qtmultimedia download-ninja download-nsis download-glib download-libxml2 download-freetype download-fontconfig download-harfbuzz download-libzip download-lib3mf download-double-conversion download-zip' else - MXE_TARGETS='i686-w64-mingw32.static.posix' - if [ "`echo $* | grep download`" ]; then - PACKAGES='download-mpfr download-eigen download-opencsg download-cgal download-qtbase download-qtmultimedia download-nsis download-glib download-libxml2 download-freetype download-fontconfig download-harfbuzz download-libzip download-lib3mf download-double-conversion' - else - PACKAGES='qtbase qtmultimedia qscintilla2 mpfr eigen opencsg cgal nsis glib libxml2 freetype fontconfig harfbuzz libzip lib3mf double-conversion' - fi +PACKAGES='qtbase qtmultimedia qscintilla2 mpfr eigen opencsg cgal ninja nsis glib libxml2 freetype fontconfig harfbuzz libzip lib3mf double-conversion zip' fi -echo make MXE_PLUGIN_DIRS=plugins/gcc7 $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS -make MXE_PLUGIN_DIRS=plugins/gcc7 $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS +echo make MXE_PLUGIN_DIRS=plugins/gcc11 $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS +make MXE_PLUGIN_DIRS=plugins/gcc11 $PACKAGES MXE_TARGETS=$MXE_TARGETS -j $NUMCPU JOBS=$NUMJOBS echo "leaving" $MXEDIR diff --git a/scripts/msys2-install-dependencies.sh b/scripts/msys2-install-dependencies.sh index 76807793a6..60c4c162b6 100644 --- a/scripts/msys2-install-dependencies.sh +++ b/scripts/msys2-install-dependencies.sh @@ -1,10 +1,19 @@ #!/bin/bash +if [ -z $MSYSTEM ]; then + MSYSTEM_DEFAULT=UCRT64 + # Possible values: (MSYS|UCRT64|CLANG64|CLANGARM64|CLANG32|MINGW64|MINGW32) + # For explanation of options see: https://www.msys2.org/docs/environments/ + echo "MSYSTEM is unset or blank, defaulting to '${MSYSTEM_DEFAULT}'"; + export MSYSTEM=$MSYSTEM_DEFAULT +else + echo "MSYSTEM is set to '$MSYSTEM'"; +fi + date "+### %Y-%m-%d %T msys2-install-dependencies started" pacman --query --explicit -export MINGW_PACKAGE_PREFIX=mingw-w64-ucrt-x86_64 date "+### %Y-%m-%d %T install pactoys (for pacboy)" pacman --noconfirm --sync --needed pactoys # pacboy is a pacman wrapper for MSYS2 which handles the package prefixes automatically @@ -26,7 +35,9 @@ pacboy --noconfirm --sync --needed \ glew:p \ qscintilla:p \ opencsg:p \ + lib3mf:p \ libzip:p \ + mimalloc:p \ double-conversion:p \ cairo:p \ ghostscript:p \ diff --git a/scripts/release-common.sh b/scripts/release-common.sh index b267376901..95e2c4046e 100755 --- a/scripts/release-common.sh +++ b/scripts/release-common.sh @@ -25,6 +25,8 @@ # .exe files # +set -e # exit when any command fails + # convert end-of-line in given file from unix \n to dos/windows(TM) \r\n # see https://kb.iu.edu/data/acux.html lf2crlf() @@ -115,13 +117,16 @@ case $OS in ZIP="zip" ZIPARGS="-r -q" echo Mingw-cross build using ARCH=$ARCH MXELIBTYPE=$MXELIBTYPE - CMAKE_CONFIG="$CMAKE_CONFIG -DMXECROSS=ON -DALLOW_BUNDLED_HIDAPI=ON" + CMAKE_CONFIG="$CMAKE_CONFIG -GNinja -DMXECROSS=ON -DALLOW_BUNDLED_HIDAPI=ON -DPACKAGE_ARCH=x86-$ARCH" ;; esac if [ "`echo $* | grep snapshot`" ]; then CMAKE_CONFIG="$CMAKE_CONFIG -DSNAPSHOT=ON -DEXPERIMENTAL=ON" + BUILD_TYPE="Release" OPENSCAD_COMMIT=`git log -1 --pretty=format:"%h"` +else + BUILD_TYPE="Release" fi BUILD_TESTS= @@ -153,35 +158,17 @@ else FAKEMAKE= fi -echo "Checking pre-requisites..." - case $OS in - UNIX_CROSS_WIN) - MAKENSIS= - if [ "`command -v makensis`" ]; then - MAKENSIS=makensis - elif [ "`command -v i686-pc-mingw32-makensis`" ]; then - # we can't find systems nsis so look for the MXE's version. - # MXE has its own makensis, but its only available under - # 32-bit MXE. note that the cross-version in theory works - # the same as the linux version so we can use them, in - # theory, interchangeably. its not really a 'cross' nsis - # todo - when doing 64 bit mingw build, see if we can call - # 32bit nsis here. - MAKENSIS=i686-pc-mingw32-makensis - else - echo "makensis not found. please install nsis on your system." - echo "(for example, on debian linux, try apt-get install nsis)" - exit 1 - fi - echo NSIS makensis found: $MAKENSIS - CMAKE=$MXE_TARGETS-cmake - ;; - *) - CMAKE=cmake - ;; + UNIX_CROSS_WIN) + CMAKE=$MXE_TARGETS-cmake + ;; + *) + CMAKE=cmake + ;; esac +echo "Checking pre-requisites..." + if [ ! -e $OPENSCADDIR/libraries/MCAD/__init__.py ]; then echo "Downloading MCAD" git submodule init @@ -204,13 +191,16 @@ fi echo "NUMCPU: " $NUMCPU cd $DEPLOYDIR -"${CMAKE}" .. $CMAKE_CONFIG \ - -DCMAKE_BUILD_TYPE="Release" \ - -DOPENSCAD_VERSION="$VERSION" \ - -DOPENSCAD_COMMIT="$OPENSCAD_COMMIT" +CMAKE_CONFIG="${CMAKE_CONFIG}\ + -DCMAKE_BUILD_TYPE=${BUILD_TYPE}\ + -DOPENSCAD_VERSION=${VERSION}\ + -DOPENSCAD_COMMIT=${OPENSCAD_COMMIT}" + +echo -e "\nRUNNING CMAKE FROM ${DEPLOYDIR}\n${CMAKE} .. ${CMAKE_CONFIG}\n" +"${CMAKE}" .. ${CMAKE_CONFIG} cd $OPENSCADDIR -echo "Building GUI binary..." +echo "Building Project..." case $OS in UNIX_CROSS_WIN) @@ -219,17 +209,20 @@ case $OS in if [ $FAKEMAKE ]; then echo "notexe. debugging build process" > openscad.exe else - make -j$NUMCPU VERBOSE=1 + ${CMAKE} --build . -j$NUMCPU + echo "Creating packages with CPack..." + ${MXE_TARGETS}-cpack + echo "Packaging Complete!" + exit fi if [ ! -e openscad.exe ]; then echo "can't find openscad.exe. build failed. stopping." - exit + exit 1 fi if [ ! -e winconsole/openscad.com ]; then echo "can't find openscad.com. build failed. stopping." - exit + exit 1 fi - mv -v winconsole/openscad.com openscad.com cd $OPENSCADDIR ;; LINUX) @@ -246,49 +239,36 @@ case $OS in ;; esac -if [[ $? != 0 ]]; then - echo "Error building OpenSCAD. Aborting." - exit 1 -fi + echo "Creating directory structure..." case $OS in MACOSX) cd $OPENSCADDIR - EXAMPLESDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources/examples - LIBRARYDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources/libraries - FONTDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources/fonts - TRANSLATIONDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources/locale - COLORSCHEMESDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources/color-schemes - SHADERSDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources/shaders - TEMPLATESDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources/templates + RESOURCEDIR=$DEPLOYDIR/OpenSCAD.app/Contents/Resources ;; UNIX_CROSS_WIN) cd $OPENSCADDIR - EXAMPLESDIR=$DEPLOYDIR/openscad-$VERSION/examples/ - LIBRARYDIR=$DEPLOYDIR/openscad-$VERSION/libraries/ - FONTDIR=$DEPLOYDIR/openscad-$VERSION/fonts/ - TRANSLATIONDIR=$DEPLOYDIR/openscad-$VERSION/locale/ - COLORSCHEMESDIR=$DEPLOYDIR/openscad-$VERSION/color-schemes/ - SHADERSDIR=$DEPLOYDIR/openscad-$VERSION/shaders/ - TEMPLATESDIR=$DEPLOYDIR/openscad-$VERSION/templates/ - rm -rf $DEPLOYDIR/openscad-$VERSION - mkdir $DEPLOYDIR/openscad-$VERSION + RESOURCEDIR=$DEPLOYDIR/openscad-$VERSION + rm -rf $RESOURCEDIR + mkdir $RESOURCEDIR ;; *) - EXAMPLESDIR=openscad-$VERSION/examples/ - LIBRARYDIR=openscad-$VERSION/libraries/ - FONTDIR=openscad-$VERSION/fonts/ - TRANSLATIONDIR=openscad-$VERSION/locale/ - COLORSCHEMESDIR=openscad-$VERSION/color-schemes/ - SHADERSDIR=openscad-$VERSION/shaders/ - TEMPLATESDIR=openscad-$VERSION/templates/ - rm -rf openscad-$VERSION - mkdir openscad-$VERSION + RESOURCEDIR=openscad-$VERSION + rm -rf $RESOURCEDIR + mkdir $RESOURCEDIR ;; esac +EXAMPLESDIR=$RESOURCEDIR/examples +FONTDIR=$RESOURCEDIR/fonts +COLORSCHEMESDIR=$RESOURCEDIR/color-schemes +SHADERSDIR=$RESOURCEDIR/shaders +TEMPLATESDIR=$RESOURCEDIR/templates +LIBRARYDIR=$RESOURCEDIR/libraries +TRANSLATIONDIR=$RESOURCEDIR/locale + if [ -n $EXAMPLESDIR ]; then echo $EXAMPLESDIR mkdir -p $EXAMPLESDIR @@ -348,8 +328,6 @@ if [ -n $TRANSLATIONDIR ]; then rm -f translations.tar fi -echo "Creating archive.." - case $OS in MACOSX) cd $DEPLOYDIR @@ -370,109 +348,6 @@ case $OS in rm -rf openscad-$VERSION echo "Binary created: openscad-$VERSION.zip" ;; - UNIX_CROSS_WIN) - cd $DEPLOYDIR - BINFILE=$DEPLOYDIR/OpenSCAD-$VERSION-x86-$ARCH.zip - INSTFILE=$DEPLOYDIR/OpenSCAD-$VERSION-x86-$ARCH-Installer.exe - - #package - fl= - if [ "`echo $* | grep shared`" ]; then - flprefix=$DEPLOYDIR/mingw-cross-env/bin - echo Copying dlls for shared library build - echo from $flprefix - fl="$fl libgmp-10.dll" - fl="$fl libgmpxx-4.dll" - fl="$fl libboost_filesystem-mt.dll" - fl="$fl libboost_program_options-mt.dll" - fl="$fl libboost_regex-mt.dll" - fl="$fl libboost_chrono-mt.dll" - fl="$fl libboost_system-mt.dll" - fl="$fl libboost_thread_win32-mt.dll" - fl="$fl libCGAL.dll" - fl="$fl libCGAL_Core.dll" - fl="$fl GLEW.dll" - fl="$fl libglib-2.0-0.dll" - fl="$fl libopencsg-1.dll" - fl="$fl libharfbuzz-0.dll" - fl="$fl libfontconfig-1.dll" - fl="$fl libexpat-1.dll" - fl="$fl libbz2.dll" - fl="$fl libintl-8.dll" - fl="$fl libiconv-2.dll" - fl="$fl libfreetype-6.dll" - fl="$fl libpcre16-0.dll" - fl="$fl zlib1.dll" - fl="$fl libpng16-16.dll" - fl="$fl icudt54.dll" - fl="$fl icudt.dll" - fl="$fl icuin.dll" - fl="$fl libstdc++-6.dll" - fl="$fl ../qt5/lib/qscintilla2.dll" - fl="$fl ../qt5/bin/Qt5PrintSupport.dll" - fl="$fl ../qt5/bin/Qt5Core.dll" - fl="$fl ../qt5/bin/Qt5Gui.dll" - fl="$fl ../qt5/bin/Qt5OpenGL.dll" - fl="$fl ../qt5/bin/Qt5Widgets.dll" - fl="$fl ../qt5/bin/Qt5PrintSupport.dll" - fl="$fl ../qt5/bin/Qt5PrintSupport.dll" - for dllfile in $fl; do - if [ -e $flprefix/$dllfile ]; then - echo $flprefix/$dllfile - cp $flprefix/$dllfile $DEPLOYDIR - else - echo cannot find $flprefix/$dllfile - echo stopping build. - exit 1 - fi - done - fi - - echo "Copying main binary .exe, .com, and dlls" - echo "to $DEPLOYDIR/openscad-$VERSION" - TMPTAR=$DEPLOYDIR/tmpmingw.$ARCH.$MXELIBTYPE.tar - cd $DEPLOYDIR - tar cvf $TMPTAR --exclude=winconsole.o *.exe *.com *.dll - cd $DEPLOYDIR/openscad-$VERSION - tar xvf $TMPTAR - cd $DEPLOYDIR - rm -f $TMPTAR - - echo "Creating binary zip package" - rm -f OpenSCAD-$VERSION.x86-$ARCH.zip - "$ZIP" $ZIPARGS $BINFILE openscad-$VERSION - cd $OPENSCADDIR - echo "Binary zip package created" - - echo "Creating installer" - echo "Copying NSIS files to $DEPLOYDIR/openscad-$VERSION" - cp ./scripts/installer$ARCH.nsi $DEPLOYDIR/openscad-$VERSION/installer_arch.nsi - cp ./scripts/installer.nsi $DEPLOYDIR/openscad-$VERSION/ - cp ./scripts/mingw-file-association.nsh $DEPLOYDIR/openscad-$VERSION/ - cp ./scripts/x64.nsh $DEPLOYDIR/openscad-$VERSION/ - cp ./scripts/LogicLib.nsh $DEPLOYDIR/openscad-$VERSION/ - cd $DEPLOYDIR/openscad-$VERSION - NSISDEBUG=-V2 - # NSISDEBUG= # leave blank for full log - echo $MAKENSIS $NSISDEBUG "-DVERSION=$VERSION" installer.nsi - $MAKENSIS $NSISDEBUG "-DVERSION=$VERSION" installer.nsi - cp $DEPLOYDIR/openscad-$VERSION/openscad_setup.exe $INSTFILE - cd $OPENSCADDIR - - if [ -e $BINFILE ]; then - if [ -e $INSTFILE ]; then - echo - echo "Binary created:" $BINFILE - echo "Installer created:" $INSTFILE - echo - else - echo "Build failed. Cannot find" $INSTFILE - fi - else - echo "Build failed. Cannot find" $BINFILE - exit 1 - fi - ;; LINUX) # Do stuff from release-linux.sh mkdir openscad-$VERSION/bin @@ -514,153 +389,3 @@ case $OS in echo ;; esac - -if [ $BUILD_TESTS ]; then - echo "Building test suite..." - case $OS in - UNIX_CROSS_WIN) - TESTBUILD_MACHINE=$MXE_TARGETS - # dont use build-machine triple in TESTBUILDDIR because the 'mingw32' - # will confuse people who are on 64 bit machines - TESTBUILDDIR=tests-build - OPENSCAD_BINDIR="$DEPLOYDIR/openscad-$VERSION" - OPENSCAD_BINARY="$OPENSCAD_BINDIR/openscad.com" - export OPENSCAD_BINARY - cd $DEPLOYDIR - mkdir $TESTBUILDDIR - cd $TESTBUILDDIR - OPENSCAD_LIBRARIES=$MXETARGETDIR $MXE_TARGETS-cmake $OPENSCADDIR/tests/ \ - -DCMAKE_TOOLCHAIN_FILE=../tests/CMingw-cross-env.cmake \ - -DMINGW_CROSS_ENV_DIR=$MXEDIR \ - -DMACHINE=$TESTBUILD_MACHINE - if [ $FAKEMAKE ]; then - echo "notexe. debugging build process" > openscad_nogui.exe - else - make -j$NUMCPU - fi - cd $OPENSCADDIR - ;; - *) - echo 'test suite build not implemented for osx/linux' - ;; - esac -fi # BUILD_TESTS - -if [ $BUILD_TESTS ]; then - echo "Creating regression tests package..." - case $OS in - MACOSX) - echo 'building regression test package on OSX not implemented' - ;; - WIN) - echo 'building regression test package on Win not implemented' - ;; - UNIX_CROSS_WIN) - # Tests output subdirectory - OPENSCAD_TESTSDIR=OpenSCAD-Tests-$VERSION - # Build a .zip file containing all the files we need to run a - # ctest on Windows(TM). For the sake of simplicity, we do not - # create an installer for the tests. - - cd $DEPLOYDIR - if [ -e ./$OPENSCAD_TESTSDIR ]; then - rm -rf ./$OPENSCAD_TESTSDIR - fi - mkdir $OPENSCAD_TESTSDIR - - # copy release files into test package dir - echo "Copying release files" - echo "from $DEPLOYDIR/openscad-$VERSION" - echo "to $DEPLOYDIR/$OPENSCAD_TESTSDIR" - TMPTAR=$DEPLOYDIR/tmpmingw.$ARCH.$MXELIBTYPE.tar - cd $DEPLOYDIR/openscad-$VERSION - tar pcvf $TMPTAR --exclude=*.ns* --exclude=*setup.exe . - cd $DEPLOYDIR/$OPENSCAD_TESTSDIR - tar pxf $TMPTAR - rm -f $TMPTAR - - echo "Copying files..." - cd $OPENSCADDIR - # This copies a lot of unnecessary stuff but that's OK. - # as above, we use tar as a somewhat portable way to do 'exclude' - # while copying. - rm -f ./ostests.tar - for subdir in tests tests/data; do - tar prvf ./ostests.tar --exclude=.git* --exclude=*.cc.obj --exclude=*.cc --exclude=*.h --exclude=CMake* --exclude=*.a $subdir - done - cd $DEPLOYDIR - tar prvf $OPENSCADDIR/ostests.tar --exclude=.git* --exclude=*.cc.obj --exclude=CMakeFiles --exclude=*.a $TESTBUILDDIR - - cd $DEPLOYDIR/$OPENSCAD_TESTSDIR - tar pxf $OPENSCADDIR/ostests.tar - rm -f $OPENSCADDIR/ostests.tar - - # Now we have the basic files copied into our tree that will become - # our .zip file. We also want to move some files around for easier - # access for the user: - cd $DEPLOYDIR/$OPENSCAD_TESTSDIR - echo "Copying files for ease of use when running from cmdline" - mv -v ./tests/OpenSCAD_Test_Console.py . - mv -v ./tests/WinReadme.txt . - mv -v ./tests/mingw_convert_ctest.py $TESTBUILDDIR - mv -v ./tests/mingwcon.bat $TESTBUILDDIR - - echo "Creating mingw_cross_info.py file" - cd $DEPLOYDIR/$OPENSCAD_TESTSDIR/$TESTBUILDDIR - if [ -e ./mingw_cross_info.py ]; then - rm -f ./mingw_cross_info.py - fi - echo "# created automatically by release-common.sh from within linux " >> mingw_cross_info.py - echo "linux_abs_basedir='"$OPENSCADDIR"'" >> mingw_cross_info.py - echo "linux_abs_builddir='"$OPENSCAD_BINDIR"'" >> mingw_cross_info.py - # Parse CTestTestfiles to find linux python strings - PYTHON_PATH=`grep -o -m 1 -h [^\"]*python[^\"]* CTestTestfile.cmake` - echo "linux_python='$PYTHON_PATH'" >> mingw_cross_info.py - # note- this has to match the CMakeLists.txt line that sets the - # convert executable... and CMingw-cross-env.cmake's skip-imagemagick - # setting. what a kludge! - echo "linux_convert='/bin/echo'" >> mingw_cross_info.py - echo "win_installdir='OpenSCAD_Tests_"$VERSIONDATE"'" >> mingw_cross_info.py - - echo 'Converting linefeed to carriage-return+linefeed' - for textfile in `find . | grep txt$`; do lf2crlf $textfile; done - for textfile in `find . | grep py$`; do lf2crlf $textfile; done - for textfile in `find . | grep cmake$`; do lf2crlf $textfile; done - for textfile in `find . | grep bat$`; do lf2crlf $textfile; done - - # Test binaries can be hundreds of megabytes due to debugging info. - # By default, we strip that. In most cases we wont need it and it - # causes too many problems to have >100MB files. - echo "stripping .exe binaries" - cd $DEPLOYDIR/$OPENSCAD_TESTSDIR - if [ "`command -v $TESTBUILD_MACHINE'-strip' `" ]; then - for exefile in *exe; do - ls -sh $exefile - echo $TESTBUILD_MACHINE'-strip' $exefile - $TESTBUILD_MACHINE'-strip' $exefile - ls -sh $exefile - done - fi - - # Build the actual .zip archive based on the file tree we've built above - cd $DEPLOYDIR - ZIPFILE=$OPENSCAD_TESTSDIR-x86-$ARCH.zip - echo "Creating binary zip package for Tests:" $ZIPFILE - rm -f ./$ZIPFILE - "$ZIP" $ZIPARGS $ZIPFILE $OPENSCAD_TESTSDIR - - if [ -e $ZIPFILE ]; then - echo "ZIP package created:" `pwd`/$ZIPFILE - else - echo "Build of Regression Tests package failed. Cannot find" `pwd`/$ZIPFILE - exit 1 - fi - cd $OPENSCADDIR - ;; - LINUX) - echo 'building regression test package on linux not implemented' - ;; - esac -else - echo "Not building regression tests package" -fi # BUILD_TESTS diff --git a/scripts/setenv-mingw-xbuild.sh b/scripts/setenv-mingw-xbuild.sh index de09fe5377..43a1eccf0f 100644 --- a/scripts/setenv-mingw-xbuild.sh +++ b/scripts/setenv-mingw-xbuild.sh @@ -77,7 +77,9 @@ PATH=$MXETARGETDIR/$MXEQTSUBDIR/bin:$PATH if [ "`echo $* | grep clean`" ]; then BASEDIR= MXEDIR= + MXE_TARGETS= MXETARGETDIR= + MXELIBTYPE= DEPLOYDIR= PATH=$MINGWX_SAVED_ORIGINAL_PATH MINGWX_SAVED_ORIGINAL_PATH= @@ -103,6 +105,7 @@ export MXEQTSUBDIR echo OPENSCAD_LIBRARIES: $OPENSCAD_LIBRARIES echo BASEDIR: $BASEDIR echo MXEDIR: $MXEDIR +echo MXE_TARGETS: $MXE_TARGETS echo MXETARGETDIR: $MXETARGETDIR echo MXELIBTYPE: $MXELIBTYPE echo DEPLOYDIR: $DEPLOYDIR @@ -115,6 +118,6 @@ else fi if [ "`echo $PATH | grep anaconda.*bin`" ]; then - echo please remove pytho anaconda/bin from your PATH, exit, and rerun this + echo please remove python anaconda/bin from your PATH, exit, and rerun this fi diff --git a/scripts/travis-ci.sh b/scripts/travis-ci.sh deleted file mode 100755 index cbc25b0ea8..0000000000 --- a/scripts/travis-ci.sh +++ /dev/null @@ -1,79 +0,0 @@ -#!/bin/bash - -set -e - -travis_nanoseconds() { - python -c 'import time; print("{:d}".format(int(time.time()*1000000000)))' -} - -travis_start() { - travis_timer_id=`printf %08x $(( RANDOM * RANDOM ))` - travis_start_time=`travis_nanoseconds` - echo -e "travis_time:start:$travis_timer_id\r\033[0m$2" - echo -e "travis_fold:start:$1\n$2" -} - -travis_finish() { - echo "travis_fold:end:$1" - travis_end_time=`travis_nanoseconds` - local duration=$(( $travis_end_time - $travis_start_time )) - echo -en "\ntravis_time:end:$travis_timer_id:start=$travis_start_time,finish=$travis_end_time,duration=$duration\r\033[0m" -} - -travis_start cmake "Building OpenSCAD using cmake" - -export PATH="/usr/local/opt/gettext/bin:$PATH" -mkdir build && cd build -cmake .. \ - -DCMAKE_BUILD_TYPE=Release \ - -DEXPERIMENTAL=ON \ - -DSNAPSHOT=ON \ - -DHEADLESS=ON -make $PARALLEL - -travis_finish cmake - -travis_start ctest "Running tests using ctest" - -# Exclude tests known the cause issues on Travis -# opencsgtest_rotate_extrude-tests - Fails on Ubuntu 12.04 using Gallium 0.4 drivers -# *_text-font-direction-tests - Fails due to old freetype (issue #899) -# throwntogethertest_issue964 - Fails due to non-planar quad being tessellated slightly different -# opencsgtest_issue1165 - z buffer tearing - -# Fails on Apple's software renderer: -# opencsgtest_issue1258 -# throwntogethertest_issue1089 -# throwntogethertest_issue1215 - -cd tests -ctest $PARALLEL_CTEST -E "\ -opencsgtest_rotate_extrude-tests|\ -opencsgtest_render-tests|\ -opencsgtest_rotate_extrude-hole|\ -opencsgtest_internal-cavity|\ -opencsgtest_internal-cavity-polyhedron|\ -opencsgtest_minkowski3-erosion|\ -opencsgtest_issue835|\ -opencsgtest_issue911|\ -opencsgtest_issue913|\ -opencsgtest_issue1215|\ -opencsgtest_issue1105d|\ -dxfpngtest_text-font-direction-tests|\ -cgalpngtest_text-font-direction-tests|\ -opencsgtest_text-font-direction-tests|\ -csgpngtest_text-font-direction-tests|\ -svgpngtest_text-font-direction-tests|\ -throwntogethertest_text-font-direction-tests|\ -throwntogethertest_issue964|\ -opencsgtest_issue1165|\ -opencsgtest_issue1258|\ -throwntogethertest_issue1089|\ -throwntogethertest_issue1215\ -$ENV_SPECIFIC_DISABLE" -if [[ $? != 0 ]]; then - echo "Test failure" - exit 1 -fi - -travis_finish ctest diff --git a/src/openscad_mimalloc.h b/src/openscad_mimalloc.h index bb2c01f777..c567af2e67 100644 --- a/src/openscad_mimalloc.h +++ b/src/openscad_mimalloc.h @@ -2,7 +2,7 @@ #ifdef USE_MIMALLOC -#if defined(_WIN32) && defined(MI_LINK_SHARED) +#if 0 // defined(_WIN32) && defined(MI_LINK_SHARED) // mimalloc doesn't support static override of malloc on Windows. // This include causes crashes if mimalloc is statically linked. #include diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index 6a837062bc..bc318226af 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -8,10 +8,9 @@ if(POLICY CMP0017) # http://www.cmake.org/cmake/help/cmake-2-8-docs.html#policy:CMP0017 cmake_policy(SET CMP0017 NEW) endif() -# Interpret IN_LIST -cmake_policy(SET CMP0057 NEW) +cmake_policy(SET CMP0057 NEW) # Interpret IN_LIST +cmake_policy(SET CMP0070 NEW) # Allow relative paths for file(GENERATE ...) -project(openscad_tests) enable_testing() # Use variables for common paths, to reduce line lengths. @@ -1303,6 +1302,89 @@ if (NOT LIB3MF_FOUND) ) endif() +list(APPEND NEF3_BROKEN_TESTS + cgalpngtest_nef3_broken + opencsgtest_nef3_broken + throwntogethertest_nef3_broken + csgpngtest_nef3_broken +) + +# Platform specific test disable +if(APPLE) + set_tests_properties( + ${NEF3_BROKEN_TESTS} + # Z issues specific to edge shader + openscad-viewoptions-edges_view-options-tests + openscad-viewoptions-axes-scales-edges_view-options-tests + PROPERTIES DISABLED TRUE + ) +elseif(UNIX) + set_tests_properties( + ${NEF3_BROKEN_TESTS} + PROPERTIES DISABLED TRUE + ) +elseif(WIN32 OR MXECROSS) + set_tests_properties( + # Z issues specific to edge shader + openscad-viewoptions-edges_view-options-tests + openscad-viewoptions-axes-scales-edges_view-options-tests + # Known UTF-8 issue on Windows + openscad-nonascii_sfære + # requires `gs` tool + pdfexporttest_centered + pdfexporttest_simple-pdf + PROPERTIES DISABLED TRUE + ) +endif() + +############################################## +# Test Installation and Packaging (Win only) # +############################################## + +# Package Tests with Windows (.zip archive only) +if(MXECROSS AND EXPERIMENTAL) + set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) + + include(CPackComponent) + cpack_add_component(Tests ARCHIVE_FILE OpenSCAD-Tests-${CPACK_PACKAGE_VERSION}) + + install(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + DESTINATION tests + USE_SOURCE_PERMISSIONS + COMPONENT Tests + PATTERN ".git*" EXCLUDE + PATTERN "OpenSCAD_Test_Console.py" EXCLUDE + PATTERN "WinReadme.txt" EXCLUDE + PATTERN "mingw_convert_ctest.py" EXCLUDE + PATTERN "mingwcon.bat" EXCLUDE + ) + install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/ + DESTINATION tests-build + USE_SOURCE_PERMISSIONS + COMPONENT Tests + PATTERN "CMakeFiles" EXCLUDE + PATTERN "CMakeLists.txt" EXCLUDE + PATTERN "cmake_install.cmake" EXCLUDE + ) + + # Move files to top project dir for visibility + install(FILES OpenSCAD_Test_Console.py DESTINATION . COMPONENT Tests) + install(FILES WinReadme.txt DESTINATION . COMPONENT Tests RENAME "Windows_Test_Readme.txt") + # Move files to tests-build dir + install(FILES mingw_convert_ctest.py DESTINATION tests-build COMPONENT Tests) + install(FILES mingwcon.bat DESTINATION tests-build COMPONENT Tests) + + file(GENERATE OUTPUT mingw_cross_info.py CONTENT +"# created automatically during packaging by cmake from within linux +linux_abs_basedir='${CMAKE_SOURCE_DIR}' +linux_abs_builddir='${CMAKE_BINARY_DIR}' +linux_python='${PYTHON_EXECUTABLE}' +linux_convert='${IMAGE_COMPARE_EXE}' +win_installdir='OpenSCAD-Tests-${CPACK_PACKAGE_VERSION}' +" NEWLINE_STYLE WIN32) + +endif() + #################### # Extra Debug Info # #################### diff --git a/tests/CMingw-cross-env.cmake b/tests/CMingw-cross-env.cmake deleted file mode 100644 index dee04c551b..0000000000 --- a/tests/CMingw-cross-env.cmake +++ /dev/null @@ -1,158 +0,0 @@ -# -# CMake Toolchain file for cross compiling OpenSCAD tests linux->mingw-win32 -# -------------------------------------------------------------------------- -# -# This CMake Toolchain file will cross-compile the regression test -# programs for OpenSCAD, and generate a CTestTestfile.cmake -# -# The result will not be directly usable. Please see doc/testing.txt -# for complete instructions for running the regression tests under Windows(TM) -# -# Prerequisites: -# -# Please see doc/testing.txt for pre-requisites. -# -# Usage: -# -# Please see doc/testing.txt for usage -# -# Please do not use this file directly unless you are experimenting. -# This file is typically called from release-common.sh automatically, -# not used directly by a human. -# -# Assuming you want to build 64bit: -# -# cd openscad -# source scripts/setenv-mingw-xbuild.sh 64 -# cd openscad/tests && mkdir build-mingw64 && cd build-mingw64 -# export OPENSCADPATH=../../libraries # (to find MCAD for some tests) -# cmake .. -DCMAKE_TOOLCHAIN_FILE=../CMingw-cross-env.cmake \ -# -DMINGW_CROSS_ENV_DIR=$MXEDIR \ -# -DMACHINE=x86_64-w64-mingw32 -# -# For 32 bit, change '64' to '32' in setenv/mkdir and use this machine: -# -DMACHINE=i686-pc-mingw32 -# -# make # (should proceed as normal.) -# -# See also: -# -# http://lists.gnu.org/archive/html/mingw-cross-env-list/2010-11/threads.html#00078 -# (thread "Qt with Cmake") -# http://lists.gnu.org/archive/html/mingw-cross-env-list/2011-01/threads.html#00012 -# (thread "Qt: pkg-config files?") -# http://mingw-cross-env.nongnu.org/#requirements -# http://www.vtk.org/Wiki/CMake_Cross_Compiling -# https://bitbucket.org/muellni/mingw-cross-env-cmake/src/2067fcf2d52e/src/cmake-1-toolchain-file.patch -# http://code.google.com/p/qtlobby/source/browse/trunk/toolchain-mingw.cmake -# http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/Link-Options.html -# Makefile.Release generated by qmake -# mingw-cross-env's qmake.conf and *.prl files -# mingw-cross-env's pkg-config files in usr/${MACHINE}/lib/pkgconfig -# (may have to add to env var PKG_CONFIG_PATH to find qt .pc files) -# http://www.vtk.org/Wiki/CMake:How_To_Find_Libraries -# - -# -# Notes: -# -# To debug the build process run "make VERBOSE=1". 'strace -f' is also useful. -# -# This file is actually called multiple times by cmake, so various 'if NOT set' -# guards are used to keep programs from running twice. -# - -# -# Part 1: Skip imagemagick search. -# - -set( SKIP_IMAGEMAGICK TRUE ) - -# -# Part 2. cross-compiler setup -# - -message(STATUS "Machine: ${MACHINE}") - -set(MINGW_CROSS_ENV_DIR $ENV{MINGW_CROSS_ENV_DIR}) - -set(BUILD_SHARED_LIBS OFF) -set(CMAKE_SYSTEM_NAME Windows) -set(MSYS 1) -set(CMAKE_FIND_ROOT_PATH ${MINGW_CROSS_ENV_DIR}/usr/${MACHINE}) -set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) -set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) -set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) - -set(CMAKE_C_COMPILER ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-gcc) -set(CMAKE_CXX_COMPILER ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-g++) -set(CMAKE_RC_COMPILER ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-windres) -set(QT_QMAKE_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-qmake) -# Fix for finding PkgConfig: see https://github.com/mxe/mxe/issues/1023 -set(PKG_CONFIG_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-pkg-config CACHE PATH "pkg-config executable" FORCE) -set(CMAKE_BUILD_TYPE RelWithDebInfo) - -# -# Part 3. library settings for mingw-cross-env -# - -set( Boost_USE_STATIC_LIBS ON ) -set( Boost_USE_MULTITHREADED ON ) -set( Boost_COMPILER "_win32" ) -# set( Boost_DEBUG TRUE ) # for debugging cmake's FindBoost, not boost itself - -set( OPENSCAD_LIBRARIES ${CMAKE_FIND_ROOT_PATH} ) -set( EIGEN2_DIR ${CMAKE_FIND_ROOT_PATH} ) -set( CGAL_DIR ${CMAKE_FIND_ROOT_PATH}/lib/CGAL ) -set( GLEW_DIR ${CMAKE_FIND_ROOT_PATH} ) - -# -# Qt4 -# -# To workaround problems with CMake's FindQt4.cmake when combined with -# mingw-cross-env (circa early 2012), we here instead use pkg-config. To -# workaround Cmake's insertion of -bdynamic, we stick 'static' on the -# end of QT_LIBRARIES -# - -set(QT_QMAKE_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-qmake) -set(QT_MOC_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-moc) -set(QT_UIC_EXECUTABLE ${MINGW_CROSS_ENV_DIR}/usr/bin/${MACHINE}-uic) - -function(mingw_cross_env_find_qt) - # called from CMakeLists.txt - set(PKGC_DEST ${MINGW_CROSS_ENV_DIR}/usr/${MACHINE}/lib/pkgconfig) - set(QT_PKGC_SRC ${MINGW_CROSS_ENV_DIR}/usr/${MACHINE}/qt/lib/pkgconfig/) - file(COPY ${QT_PKGC_SRC} DESTINATION ${PKGC_DEST} FILES_MATCHING PATTERN "*.pc") - - find_package( PkgConfig ) - pkg_check_modules( QTCORE QtCore ) - pkg_check_modules( QTGUI QtGui ) - pkg_check_modules( QTOPENGL QtOpenGL ) - - set(QT_INCLUDE_DIRS ${QTCORE_INCLUDE_DIRS} ${QTGUI_INCLUDE_DIRS} ${QTOPENGL_INCLUDE_DIRS}) - set(QT_CFLAGS_OTHER "${QTCORE_CFLAGS_OTHER} ${QTGUI_CFLAGS_OTHER} ${QTOPENGL_CFLAGS_OTHER}") - set(QT_LIBRARIES "${QTCORE_STATIC_LDFLAGS} ${QTGUI_STATIC_LDFLAGS} ${QTOPENGL_STATIC_LDFLAGS};-static") - - set(QT_INCLUDE_DIRS ${QT_INCLUDE_DIRS} PARENT_SCOPE) - set(QT_CFLAGS_OTHER ${QT_CFLAGS_OTHER} PARENT_SCOPE) - set(QT_LIBRARIES ${QT_LIBRARIES} PARENT_SCOPE) -endfunction() - -function(mingw_cross_env_info) - message(STATUS "QT INCLUDE_DIRS: ${QT_INCLUDE_DIRS}") - message(STATUS "QT LIBRARIES: ${QT_LIBRARIES}") - message(STATUS "QT_CFLAGS_OTHER: ${QT_CFLAGS_OTHER}") -endfunction() - -# -# Part 4. -D definitions -# - -if( NOT cross_defs_set ) - add_definitions( -DGLEW_STATIC ) # FindGLEW.cmake needs this - add_definitions( -DBOOST_STATIC ) - add_definitions( -DBOOST_THREAD_USE_LIB ) - add_definitions( -DUNICODE ) # because qmake does it - set(cross_defs_set 1) -endif() diff --git a/tests/EnforceConfig.cmake b/tests/EnforceConfig.cmake index 8ef7be8d74..58d8acbd39 100644 --- a/tests/EnforceConfig.cmake +++ b/tests/EnforceConfig.cmake @@ -1,4 +1,4 @@ if(NOT CTEST_CONFIGURATION_TYPE) - message("Enforcing Default test configuration. Use ctest -C to override") + message(STATUS "Enforcing Default test configuration. Use ctest -C to override") set(CTEST_CONFIGURATION_TYPE Default) endif() diff --git a/tests/OpenSCAD_Test_Console.py b/tests/OpenSCAD_Test_Console.py index e35323cdba..107e7ab775 100644 --- a/tests/OpenSCAD_Test_Console.py +++ b/tests/OpenSCAD_Test_Console.py @@ -6,6 +6,7 @@ # public domain, by Don Bright import os,sys +import shutil thisfile_abspath=os.path.abspath(__file__) thisdir_abspath=os.path.abspath(os.path.dirname(thisfile_abspath)) @@ -23,24 +24,27 @@ import mingw_convert_ctest mingw_convert_ctest.run() -print('searching for ctest.exe') -ctestpath='' -for basedir in 'C:/Program Files','C:/Program Files (x86)': - if os.path.isdir(basedir): - pflist = os.listdir(basedir) - for subdir in pflist: - if 'cmake' in subdir.lower(): - abssubdir=os.path.join(basedir,subdir) - for root,dirs,files in os.walk(abssubdir): - if 'ctest.exe' in files: - ctestpath=os.path.join(root,'ctest.exe') - -if not os.path.isfile(ctestpath): - print('error, cant find ctest.exe') +if shutil.which('ctest') is not None: + print('ctest.exe is already on the path') else: - ctestdir = os.pathsep + os.path.dirname(ctestpath) - print('adding ctest dir to PATH: ' + ctestdir) - os.environ['PATH'] += ctestdir + print('searching for ctest.exe') + ctestpath='' + for basedir in 'C:/Program Files','C:/Program Files (x86)': + if os.path.isdir(basedir): + pflist = os.listdir(basedir) + for subdir in pflist: + if 'cmake' in subdir.lower(): + abssubdir=os.path.join(basedir,subdir) + for root,dirs,files in os.walk(abssubdir): + if 'ctest.exe' in files: + ctestpath=os.path.join(root,'ctest.exe') + + if not os.path.isfile(ctestpath): + print('error, cant find ctest.exe') + else: + ctestdir = os.pathsep + os.path.dirname(ctestpath) + print('adding ctest dir to PATH: ' + ctestdir) + os.environ['PATH'] += ctestdir #cmd = 'start "OpenSCAD Test console" /wait /d c:\\temp cmd.exe' #cmd = 'start /d "'+starting_dir+'" cmd.exe "OpenSCAD Test Console"' @@ -48,9 +52,3 @@ cmd = 'start /d "'+starting_dir+'" cmd.exe "/k" "'+conbat+'"' print('opening console: running ' + cmd) os.system( cmd ) - -# figure out how to run convert script -# dont use mingw64 in linbuild path? -# figure out better windows prompt, can it be set? - - diff --git a/tests/mingw_convert_ctest.py b/tests/mingw_convert_ctest.py index afaa77888c..2cda102fa2 100644 --- a/tests/mingw_convert_ctest.py +++ b/tests/mingw_convert_ctest.py @@ -61,14 +61,17 @@ def debug(*args): linconv=mingw_cross_info.linux_convert #'/usr/bin/convert' -linoslib='OPENSCADPATH='+linbase+'/tests/../libraries' -winoslib='OPENSCADPATH='+winbase+'/tests/../libraries' +linoslib='OPENSCADPATH='+linbase+'/libraries' +winoslib='OPENSCADPATH='+winbase+'/libraries' + +lintestdeploy=linbuild+'/tests' +wintestdeploy=winbuild+'/tests-build' lintestdata=linbase+'/tests/data' wintestdata=winbase+'/tests/data' -linexamples=linbase+'/tests/../examples' -winexamples=winbase+'/tests/../examples' +linexamples=linbase+'/examples' +winexamples=winbase+'/examples' def find_imagemagick(): # Find imagemagick's convert.exe @@ -137,7 +140,7 @@ def processfile(infilename, winconv): lines=fin.readlines() fout=open(outfilename,'w') fout.write('#'+os.linesep) - fout.write('# modified by mingw_x_testfile.py'+os.linesep) + fout.write('# modified by mingw_convert_ctest.py'+os.linesep) fout.write('#'+os.linesep) debug('inputname',infilename) @@ -152,10 +155,11 @@ def processfile(infilename, winconv): line=re.sub('--builddir=[^ "]*', '', line) line=line.replace(linosng,winosng) + line=line.replace(lintestdeploy,wintestdeploy) # this should fix path of diffpng. must come before linbuild replacement line=line.replace(linbuild,winbuild) line=line.replace(lintct,wintct) line=line.replace(linpy,winpy) - line=line.replace(linconv,winconv) + #line=line.replace(linconv,winconv) line=line.replace(linoslib,winoslib) line=line.replace(lintestdata,wintestdata) line=line.replace(linexamples,winexamples) @@ -213,6 +217,8 @@ def run(): print(thisfile_abspath) print('linbase ' + linbase) print('winbase ' + winbase) + print('lintestdeploy ' + lintestdeploy) + print('wintestdeploy ' + wintestdeploy) print('linbuild ' + linbuild) print('winbuild ' + winbuild) print('lintct ' + lintct) @@ -221,8 +227,8 @@ def run(): print('winpy ' + winpy) print('linosng ' + linosng) print('winosng ' + winosng) - print('linconv ' + linconv) - print('winconv ' + winconv) + #print('linconv ' + linconv) # use diffpng, included in archive, as opposed to ImageMagick + #print('winconv ' + winconv) print('linoslib ' + linoslib) print('winoslib ' + winoslib) print('lintestdata ' + lintestdata) diff --git a/tests/nulltest.sh b/tests/nulltest.sh deleted file mode 100755 index 7b84f51fa5..0000000000 --- a/tests/nulltest.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -rm -f render.png cgal.png preview.png -./openscad_nogui $1 -o preview.png -./openscad_nogui $1 -o render.png --render -./openscad_nogui $1 -o cgal.png --render=cgal - -for type in preview render cgal; do - echo -n "$type: " - if [ -f $type.png ]; then - if [ -s $type.png ]; then - diff $type.png empty.png > /dev/null - if [ $? -eq 0 ]; then - echo "Empty" - else - echo "X" - fi - else - echo "Zero" - fi - else - echo "None" - fi -done diff --git a/tests/regression/cgalpngtest/issue1165-expected.png b/tests/regression/cgalpngtest/issue1165-expected.png index 7c5c1ec6a9..7db4e97313 100644 Binary files a/tests/regression/cgalpngtest/issue1165-expected.png and b/tests/regression/cgalpngtest/issue1165-expected.png differ diff --git a/tests/test_cmdline_tool.py b/tests/test_cmdline_tool.py index 2bf0240ae0..cf3b2ee82b 100755 --- a/tests/test_cmdline_tool.py +++ b/tests/test_cmdline_tool.py @@ -38,6 +38,27 @@ #_debug_tcct = True _debug_tcct = False +# Path from the build/tests to the tests source dir +build_to_test_sources = "../../tests" + +def get_runtime_to_test_sources(): + """Path from the tests install/working dir to the tests source dir. + Tests are usually run from the build dir so no issue, however with mingw cross builds, + the tests are installed to openscad/tests-build which is only one directory deeper than the top level. + Expected outputs that reference use/include files will need their relative paths adjusted.""" + cwd = os.getcwd() + up_one = os.path.normpath(os.path.join(cwd, "..")) + parent_dir = os.path.basename(up_one) + if (parent_dir != "build"): + # only check binary path if NOT within a build tree. + OPENSCAD_BINARY = os.getenv('OPENSCAD_BINARY') + if (OPENSCAD_BINARY is not None): + project_dir = os.path.dirname(OPENSCAD_BINARY) + test_cmake_dir = os.path.join(project_dir, "CMakeFiles") + if (not os.path.exists(test_cmake_dir)): + return os.path.relpath(project_dir, cwd) + "/tests" + return build_to_test_sources + def debug(*args): global _debug_tcct if _debug_tcct: @@ -123,31 +144,35 @@ def pathrep(match): return s -def get_normalized_text(filename): - try: +def get_normalized_text(filename, replace_paths=False): + try: f = open(filename) text = f.read() - except: + except: try: # 'ord-tests.scad' contains some invalid UTF-8 chars. # latin-1 is for "files in an ASCII compatible encoding, # best effort is acceptable". f = open(filename, encoding="latin-1") text = f.read() - except: + except: # do not fail silently - text = "could not read " + "\n" + filename + "\n" + repr(err) - text = normalize_string(text) - return text.strip("\r\n").replace("\r\n", "\n") + "\n" - -def compare_text(expected, actual): - return get_normalized_text(expected) == get_normalized_text(actual) + text = "could not read " + "\n" + filename + "\n" + repr(err) + text = normalize_string(text).strip("\r\n").replace("\r\n", "\n") + "\n" + if replace_paths: + runtime_to_test_sources = get_runtime_to_test_sources() + if runtime_to_test_sources != build_to_test_sources: + return text.replace(build_to_test_sources, runtime_to_test_sources) + else: + return text + else: + return text def compare_default(resultfilename): print('text comparison: ', file=sys.stderr) print(' expected textfile: ', expectedfilename, file=sys.stderr) print(' actual textfile: ', resultfilename, file=sys.stderr) - expected_text = get_normalized_text(expectedfilename) + expected_text = get_normalized_text(expectedfilename, True) actual_text = get_normalized_text(resultfilename) if not expected_text == actual_text: if resultfilename: @@ -228,6 +253,9 @@ def post_process_3mf(filename): from zipfile import ZipFile xml_content = ZipFile(filename).read("3D/3dmodel.model") xml_content = re.sub('UUID="[^"]*"', 'UUID="XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXX"', xml_content.decode('utf-8')) + # lib3mf v2 has an additional attribute compared to v1 + sc = ' xmlns:sc="http://schemas.microsoft.com/3dmanufacturing/securecontent/2019/04"' + xml_content = xml_content.replace(sc, '') # add tag end whitespace for lib3mf 2.0 output files xml_content = re.sub('\"/>', '\" />', xml_content) with open(filename, 'wb') as xml_file: