Skip to content

Commit

Permalink
Remove test packaging from release-common.sh and convert entirely int…
Browse files Browse the repository at this point in the history
…o cpack.

Tests are now bundled with windows package, but only with the zip archive.
Update doc/testing.txt to better reflect the current situation.
  • Loading branch information
thehans committed Nov 26, 2022
1 parent 4a632c9 commit 15035e9
Show file tree
Hide file tree
Showing 6 changed files with 99 additions and 319 deletions.
21 changes: 13 additions & 8 deletions CMakeLists.txt
Expand Up @@ -945,11 +945,12 @@ if(NOT APPLE OR APPLE_UNIX)
install(DIRECTORY ${CMAKE_CURRENT_LIST_DIR}/templates DESTINATION "${OPENSCAD_INSTALL_RESOURCEDIR}" FILES_MATCHING PATTERN "*.json")
endif()

# Packaging
# 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})
Expand All @@ -972,14 +973,12 @@ if(MXECROSS)
")
endif()
set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/COPYING")
set(CPACK_INSTALL_CMAKE_PROJECTS "${CMAKE_CURRENT_BINARY_DIR};${CMAKE_PROJECT_NAME};ALL;/")
set(CPACK_PROJECT_CONFIG_FILE "${CMAKE_CURRENT_SOURCE_DIR}/cmake/Modules/openscad_cpack.cmake")
# 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)
include(CPack)

if(INFO)
include("cmake/Modules/info.cmake")
endif()

if(ENABLE_TESTS)
add_subdirectory(tests)
Expand All @@ -988,3 +987,9 @@ endif()
if(OFFLINE_DOCS)
add_subdirectory(resources)
endif()

include(CPack)

if(INFO)
include("cmake/Modules/info.cmake")
endif()
11 changes: 0 additions & 11 deletions cmake/Modules/openscad_cpack.cmake

This file was deleted.

15 changes: 15 additions & 0 deletions 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()
49 changes: 15 additions & 34 deletions doc/testing.txt
Expand Up @@ -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 <regex> Runs only matching tests, e.g. ctest -R dxf
$ ctest -C <configs> Adds extended tests belonging to configs.
Expand Down

0 comments on commit 15035e9

Please sign in to comment.