openscad-unstable: run tests

This commit is contained in:
pca006132 2024-02-23 14:15:16 +08:00
parent b687a81b3f
commit 3ddb1c3c09
2 changed files with 68 additions and 7 deletions

View file

@ -15,25 +15,27 @@
, flex , flex
, fontconfig , fontconfig
, freetype , freetype
, ghostscript
, glib , glib
, glm , glm
, gmp , gmp
, harfbuzz , harfbuzz
, hidapi , hidapi
, lib3mf , lib3mf
, libGL
, libGLU , libGLU
, libICE , libICE
, libSM , libSM
, libsForQt5 , libsForQt5
, libspnav , libspnav
, libzip , libzip
, mesa
, mpfr , mpfr
, python3 , python3
, tbb_2021_8 , tbb_2021_8
, wayland , wayland
, wayland-protocols , wayland-protocols
, wrapGAppsHook , wrapGAppsHook
, xorg
}: }:
let let
# get cccl from source to avoid license issues # get cccl from source to avoid license issues
@ -87,16 +89,17 @@ clangStdenv.mkDerivation rec {
hash = "sha256-i2ZGYsNfMLDi3wRd/lohs9BuO2KuQ/7kJIXGtV65OQU="; hash = "sha256-i2ZGYsNfMLDi3wRd/lohs9BuO2KuQ/7kJIXGtV65OQU=";
fetchSubmodules = true; fetchSubmodules = true;
}; };
patches = [ ./test.diff ];
nativeBuildInputs = [ nativeBuildInputs = [
pkg-config (python3.withPackages (ps: with ps; [ numpy pillow ]))
cmake
ninja
bison bison
cmake
flex flex
python3
libsForQt5.qt5.wrapQtAppsHook libsForQt5.qt5.wrapQtAppsHook
llvmPackages.bintools llvmPackages.bintools
wrapGAppsHook wrapGAppsHook
ninja
pkg-config
]; ];
buildInputs = with libsForQt5; with qt5; [ buildInputs = with libsForQt5; with qt5; [
# manifold dependencies # manifold dependencies
@ -112,6 +115,7 @@ clangStdenv.mkDerivation rec {
eigen eigen
fontconfig fontconfig
freetype freetype
ghostscript
glib glib
gmp gmp
harfbuzz harfbuzz
@ -124,7 +128,15 @@ clangStdenv.mkDerivation rec {
qtbase qtbase
qtmultimedia qtmultimedia
] ]
++ lib.optionals clangStdenv.isLinux [ libICE libSM libGLU libGL wayland wayland-protocols qtwayland ] ++ lib.optionals clangStdenv.isLinux [
xorg.libXdmcp
libICE
libSM
wayland
wayland-protocols
qtwayland
libGLU
]
++ lib.optional clangStdenv.isDarwin qtmacextras ++ lib.optional clangStdenv.isDarwin qtmacextras
; ;
cmakeFlags = [ cmakeFlags = [
@ -133,11 +145,18 @@ clangStdenv.mkDerivation rec {
"-DUSE_BUILTIN_OPENCSG=ON" # bundled latest opencsg "-DUSE_BUILTIN_OPENCSG=ON" # bundled latest opencsg
"-DOPENSCAD_VERSION=\"${builtins.replaceStrings ["-"] ["."] version}\"" "-DOPENSCAD_VERSION=\"${builtins.replaceStrings ["-"] ["."] version}\""
"-DCMAKE_UNITY_BUILD=ON" # faster build "-DCMAKE_UNITY_BUILD=ON" # faster build
"-DENABLE_TESTS=OFF" # tests do not work for now
# IPO # IPO
"-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld" "-DCMAKE_EXE_LINKER_FLAGS=-fuse-ld=lld"
"-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON" "-DCMAKE_INTERPROCEDURAL_OPTIMIZATION=ON"
]; ];
doCheck = true;
checkPhase = ''
# for running mesa llvmpipe
export __EGL_VENDOR_LIBRARY_FILENAMES=${mesa.drivers}/share/glvnd/egl_vendor.d/50_mesa.json
export LIBGL_DRIVERS_PATH=${mesa.drivers}/lib:${mesa.drivers}/lib/dri
# some fontconfig issues cause pdf output to have wrong font
ctest -j$NIX_BUILD_CORES -E pdfexporttest.\*
'';
meta = with lib; { meta = with lib; {
description = "3D parametric model compiler (unstable)"; description = "3D parametric model compiler (unstable)";
longDescription = '' longDescription = ''

View file

@ -0,0 +1,42 @@
diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt
index 5c1b40af4..917451dee 100644
--- a/tests/CMakeLists.txt
+++ b/tests/CMakeLists.txt
@@ -59,13 +59,14 @@ if(USE_IMAGE_COMPARE_PY)
# Since msys2 on Windows prefers bin/ over Scripts, we need to look for the actual folder to determine
# how to utilize the venv
- find_path(VENV_BIN_PATH activate PATHS "${VENV_DIR}/bin" "${VENV_DIR}/Scripts" NO_DEFAULT_PATH NO_CACHE)
- if(WIN32)
- set(IMAGE_COMPARE_EXE "${VENV_BIN_PATH}/python.exe")
- else()
- set(IMAGE_COMPARE_EXE "${VENV_BIN_PATH}/python")
- endif()
- if(EXISTS "${IMAGE_COMPARE_EXE}")
+ # find_path(VENV_BIN_PATH activate PATHS "${VENV_DIR}/bin" "${VENV_DIR}/Scripts" NO_DEFAULT_PATH NO_CACHE)
+ # if(WIN32)
+ # set(IMAGE_COMPARE_EXE "${VENV_BIN_PATH}/python.exe")
+ # else()
+ # set(IMAGE_COMPARE_EXE "${VENV_BIN_PATH}/python")
+ # endif()
+ set(IMAGE_COMPARE_EXE "python3")
+ # if(EXISTS "${IMAGE_COMPARE_EXE}")
message(STATUS "venv found, testing libraries")
execute_process(
COMMAND "${IMAGE_COMPARE_EXE}" "${CCSD}/image_compare.py" "--status"
@@ -77,10 +78,10 @@ if(USE_IMAGE_COMPARE_PY)
message(STATUS "venv libraries complete")
set(BUILD_VENV FALSE)
endif()
- else()
- message(STATUS "venv not found")
- set(BUILD_VENV TRUE)
- endif()
+ # else()
+ # message(STATUS "venv not found")
+ # set(BUILD_VENV TRUE)
+ # endif()
if(BUILD_VENV)
message(STATUS "Setting up testing venv for image comparison")
execute_process(