From 918713eb7c19d23b27f27a0eb640c2d0b219619e Mon Sep 17 00:00:00 2001 From: Matt McCormick Date: Wed, 11 Sep 2024 14:43:35 -0400 Subject: [PATCH] build(compare-meshes): add native pixi build-test configuration --- itk_wasm_env.bash | 3 +++ packages/compare-meshes/package.json | 4 ++++ pixi.toml | 27 +++++++++++++++++++++++++++ 3 files changed, 34 insertions(+) diff --git a/itk_wasm_env.bash b/itk_wasm_env.bash index c3cb7f0a6..77ae9f9b0 100755 --- a/itk_wasm_env.bash +++ b/itk_wasm_env.bash @@ -31,5 +31,8 @@ export ITK_WASM_DICOM_TEST_DATA_URLS=${ITK_WASM_DICOM_TEST_DATA_URLS:-$(cat pack export ITK_WASM_COMPARE_IMAGES_TEST_DATA_HASH=${ITK_WASM_COMPARE_IMAGES_TEST_DATA_HASH:-$(cat packages/compare-images/package.json | jq -e -r '."itk-wasm"."test-data-hash"')} export ITK_WASM_COMPARE_IMAGES_TEST_DATA_URLS=${ITK_WASM_COMPARE_IMAGES_TEST_DATA_URLS:-$(cat packages/compare-images/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')} +export ITK_WASM_COMPARE_MESHES_TEST_DATA_HASH=${ITK_WASM_COMPARE_MESHES_TEST_DATA_HASH:-$(cat packages/compare-meshes/package.json | jq -e -r '."itk-wasm"."test-data-hash"')} +export ITK_WASM_COMPARE_MESHES_TEST_DATA_URLS=${ITK_WASM_COMPARE_MESHES_TEST_DATA_URLS:-$(cat packages/compare-meshes/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')} + export ITK_WASM_MESH_IO_TEST_DATA_HASH=${ITK_WASM_MESH_IO_TEST_DATA_HASH:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-hash"')} export ITK_WASM_MESH_IO_TEST_DATA_URLS=${ITK_WASM_MESH_IO_TEST_DATA_URLS:-$(cat packages/mesh-io/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')} diff --git a/packages/compare-meshes/package.json b/packages/compare-meshes/package.json index 050bf62f5..b452f6b70 100644 --- a/packages/compare-meshes/package.json +++ b/packages/compare-meshes/package.json @@ -8,6 +8,10 @@ "itk-wasm": { "emscripten-docker-image": "itkwasm/emscripten:latest", "wasi-docker-image": "itkwasm/wasi:latest", + "test-data-hash": "bafybeiafli6egtmkcgany65po64w67hpqnmgwr5utqo6ycbbz7k5l33llu", + "test-data-urls": [ + "https://github.com/InsightSoftwareConsortium/ITK-Wasm/releases/download/itk-wasm-v1.0.0-b.171/compare-images-test-data.tar.gz" + ], "package-description": "Compare meshes and polydata for regression testing.", "typescript-package-name": "@itk-wasm/compare-meshes", "python-package-name": "itkwasm-compare-meshes", diff --git a/pixi.toml b/pixi.toml index 72a6ce514..3b208760f 100644 --- a/pixi.toml +++ b/pixi.toml @@ -29,6 +29,13 @@ depends-on = ["pnpm-install"] outputs = ["packages/compare-images/test/data.tar.gz"] description = "Download compare-images test data" +[tasks.compare-meshes-test-data-download] +cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_COMPARE_MESHES_TEST_DATA_HASH $ITK_WASM_COMPARE_MESHES_TEST_DATA_URLS" +cwd = "packages/compare-meshes" +depends-on = ["pnpm-install"] +outputs = ["packages/compare-meshes/test/data.tar.gz"] +description = "Download compare-meshes test data" + [tasks.mesh-io-test-data-download] cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_MESH_IO_TEST_DATA_HASH $ITK_WASM_MESH_IO_TEST_DATA_URLS" cwd = "packages/mesh-io" @@ -188,6 +195,26 @@ cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/compare-images-build" depends-on = ["build-native-compare-images"] description = "Test compare-images native binaries" +[feature.native.tasks.configure-native-compare-meshes] +cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/compare-meshes-build -Spackages/compare-meshes -GNinja + -DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR + -DBUILD_TESTING:BOOL=ON + -DCMAKE_CXX_STANDARD:STRING=20 + -DCMAKE_BUILD_TYPE:STRING=Debug''' +depends-on = ["build-itk-wasm", "compare-meshes-test-data-download"] +outputs = ["native/compare-meshes-build/CMakeFiles/"] +description = "Configure compare-meshes native binaries" + +[feature.native.tasks.build-native-compare-meshes] +cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/compare-meshes-build" +depends-on = ["configure-native-compare-meshes"] +description = "Build compare-meshes native binaries" + +[feature.native.tasks.test-native-compare-meshes] +cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/compare-meshes-build" +depends-on = ["build-native-compare-meshes"] +description = "Test compare-meshes native binaries" + [feature.native.tasks.configure-native-mesh-io] cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/mesh-io-build -Spackages/mesh-io -GNinja -DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR