Skip to content

Commit 9ef2ee8

Browse files
committed
build(image-io): add native pixi build-test configuration
1 parent 007e79a commit 9ef2ee8

File tree

3 files changed

+35
-0
lines changed

3 files changed

+35
-0
lines changed

itk_wasm_env.bash

+3
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,6 @@ export ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS=${ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS:-
4242

4343
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"')}
4444
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(" ")')}
45+
46+
export ITK_WASM_IMAGE_IO_TEST_DATA_HASH=${ITK_WASM_IMAGE_IO_TEST_DATA_HASH:-$(cat packages/image-io/package.json | jq -e -r '."itk-wasm"."test-data-hash"')}
47+
export ITK_WASM_IMAGE_IO_TEST_DATA_URLS=${ITK_WASM_IMAGE_IO_TEST_DATA_URLS:-$(cat packages/image-io/package.json | jq -e -r '."itk-wasm"."test-data-urls" | join(" ")')}

packages/image-io/package.json

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
"itk-wasm": {
99
"emscripten-docker-image": "itkwasm/emscripten:latest",
1010
"wasi-docker-image": "itkwasm/wasi:latest",
11+
"test-data-hash": "bafybeibyjhkcrinl2lotw5g2vngjs23aaenv3tjzxssm35jxaci5ylsqia",
12+
"test-data-urls": [
13+
"https://github.com/InsightSoftwareConsortium/ITK-Wasm/releases/download/itk-wasm-v1.0.0-b.155/image-io-test-data.tar.gz",
14+
"https://w3s.link/ipfs/bafybeiewe4rankwwe7nw7qm2g3qclflhci2e53wthn3gukdlhbff64pua4/data.tar.gz"
15+
],
1116
"typescript-package-name": "@itk-wasm/image-io",
1217
"python-package-name": "itkwasm-image-io",
1318
"package-description": "Input and output for scientific and medical image file formats.",

pixi.toml

+27
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ depends-on = ["pnpm-install"]
5757
outputs = ["packages/mesh-io/test/data.tar.gz"]
5858
description = "Download mesh-io test data"
5959

60+
[tasks.image-io-test-data-download]
61+
cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_IMAGE_IO_TEST_DATA_HASH $ITK_WASM_IMAGE_IO_TEST_DATA_URLS"
62+
cwd = "packages/image-io"
63+
depends-on = ["pnpm-install"]
64+
outputs = ["packages/image-io/test/data.tar.gz"]
65+
description = "Download image-io test data"
66+
6067
[tasks.export-itk-wasm-env-vars]
6168
cmd = "bash -c ./itk_wasm_env.bash && env | grep ITK_WASM | grep -v TEST > ./src/docker/itk-wasm-base/itk_wasm_env_vars.sh"
6269
outputs = ["src/docker/itk-wasm-base/itk_wasm_env_vars.*"]
@@ -289,6 +296,26 @@ cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/mesh-io-build"
289296
depends-on = ["build-native-mesh-io"]
290297
description = "Test mesh-io native binaries"
291298

299+
[feature.native.tasks.configure-native-image-io]
300+
cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/image-io-build -Spackages/image-io -GNinja
301+
-DITK_DIR:PATH=$ITK_WASM_ITK_BUILD_DIR
302+
-DBUILD_TESTING:BOOL=ON
303+
-DCMAKE_CXX_STANDARD:STRING=20
304+
-DCMAKE_BUILD_TYPE:STRING=Debug'''
305+
depends-on = ["build-itk-wasm", "image-io-test-data-download"]
306+
outputs = ["native/image-io-build/CMakeFiles/"]
307+
description = "Configure image-io native binaries"
308+
309+
[feature.native.tasks.build-native-image-io]
310+
cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/image-io-build"
311+
depends-on = ["configure-native-image-io"]
312+
description = "Build image-io native binaries"
313+
314+
[feature.native.tasks.test-native-image-io]
315+
cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/image-io-build"
316+
depends-on = ["build-native-image-io"]
317+
description = "Test image-io native binaries"
318+
292319
[feature.native.dependencies]
293320
cmake = ">=3.30.2,<4"
294321
cxx-compiler = ">=1.7.0,<2"

0 commit comments

Comments
 (0)