Skip to content

Commit

Permalink
Merge pull request #1231 from thewtex/native-compare-meshes
Browse files Browse the repository at this point in the history
build(compare-meshes): add native pixi build-test configuration
  • Loading branch information
thewtex authored Sep 12, 2024
2 parents a763747 + 918713e commit 4697ee5
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 0 deletions.
3 changes: 3 additions & 0 deletions itk_wasm_env.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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(" ")')}
4 changes: 4 additions & 0 deletions packages/compare-meshes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
27 changes: 27 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 4697ee5

Please sign in to comment.