Skip to content

Commit

Permalink
Merge pull request #1223 from thewtex/compare-images-native
Browse files Browse the repository at this point in the history
build(compare-images): add native pixi build-test configuration
  • Loading branch information
thewtex committed Sep 10, 2024
2 parents 107c79b + e520a0d commit 3d75909
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 @@ -28,5 +28,8 @@ mkdir -p ${ITK_WASM_ITK_BUILD_DIR} || die "Could not create ITK build directory"
export ITK_WASM_DICOM_TEST_DATA_HASH=${ITK_WASM_DICOM_TEST_DATA_HASH:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
export ITK_WASM_DICOM_TEST_DATA_URLS=${ITK_WASM_DICOM_TEST_DATA_URLS:-$(cat packages/dicom/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

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_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-images/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"
],
"typescript-package-name": "@itk-wasm/compare-images",
"python-package-name": "itkwasm-compare-images",
"package-description": "Compare images with a tolerance for regression testing.",
Expand Down
27 changes: 27 additions & 0 deletions pixi.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,13 @@ depends-on = ["pnpm-install"]
outputs = ["packages/dicom/test/data.tar.gz"]
description = "Download DICOM test data"

[tasks.compare-images-test-data-download]
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_COMPARE_IMAGES_TEST_DATA_HASH $ITK_WASM_COMPARE_IMAGES_TEST_DATA_URLS"
cwd = "packages/compare-images"
depends-on = ["pnpm-install"]
outputs = ["packages/compare-images/test/data.tar.gz"]
description = "Download compare-images 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 @@ -161,6 +168,26 @@ cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/dicom-build"
depends-on = ["build-native-dicom"]
description = "Test dicom native binaries"

[feature.native.tasks.configure-native-compare-images]
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/compare-images-build -Spackages/compare-images -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-images-test-data-download"]
outputs = ["native/compare-images-build/CMakeFiles/"]
description = "Configure compare-images native binaries"

[feature.native.tasks.build-native-compare-images]
cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/compare-images-build"
depends-on = ["configure-native-compare-images"]
description = "Build compare-images native binaries"

[feature.native.tasks.test-native-compare-images]
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-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 3d75909

Please sign in to comment.