diff --git a/itk_wasm_env.bash b/itk_wasm_env.bash index 7402f200a..1fb3a3d9b 100755 --- a/itk_wasm_env.bash +++ b/itk_wasm_env.bash @@ -42,3 +42,6 @@ export ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS=${ITK_WASM_DOWNSAMPLE_TEST_DATA_URLS:- 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(" ")')} + +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"')} +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(" ")')} \ No newline at end of file diff --git a/packages/image-io/package.json b/packages/image-io/package.json index fc1d8948b..fa7a7c339 100644 --- a/packages/image-io/package.json +++ b/packages/image-io/package.json @@ -8,6 +8,11 @@ "itk-wasm": { "emscripten-docker-image": "itkwasm/emscripten:latest", "wasi-docker-image": "itkwasm/wasi:latest", + "test-data-hash": "bafybeibyjhkcrinl2lotw5g2vngjs23aaenv3tjzxssm35jxaci5ylsqia", + "test-data-urls": [ + "https://github.com/InsightSoftwareConsortium/ITK-Wasm/releases/download/itk-wasm-v1.0.0-b.155/image-io-test-data.tar.gz", + "https://w3s.link/ipfs/bafybeiewe4rankwwe7nw7qm2g3qclflhci2e53wthn3gukdlhbff64pua4/data.tar.gz" + ], "typescript-package-name": "@itk-wasm/image-io", "python-package-name": "itkwasm-image-io", "package-description": "Input and output for scientific and medical image file formats.", diff --git a/pixi.toml b/pixi.toml index 97eaa5b19..e08ce60ea 100644 --- a/pixi.toml +++ b/pixi.toml @@ -57,6 +57,13 @@ depends-on = ["pnpm-install"] outputs = ["packages/mesh-io/test/data.tar.gz"] description = "Download mesh-io test data" +[tasks.image-io-test-data-download] +cmd = "npx dam download test/data test/data.tar.gz $ITK_WASM_IMAGE_IO_TEST_DATA_HASH $ITK_WASM_IMAGE_IO_TEST_DATA_URLS" +cwd = "packages/image-io" +depends-on = ["pnpm-install"] +outputs = ["packages/image-io/test/data.tar.gz"] +description = "Download image-io test data" + [tasks.export-itk-wasm-env-vars] cmd = "bash -c ./itk_wasm_env.bash && env | grep ITK_WASM | grep -v TEST > ./src/docker/itk-wasm-base/itk_wasm_env_vars.sh" 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" depends-on = ["build-native-mesh-io"] description = "Test mesh-io native binaries" +[feature.native.tasks.configure-native-image-io] +cmd = '''cmake -B$ITK_WASM_NATIVE_WORKSPACE/image-io-build -Spackages/image-io -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", "image-io-test-data-download"] +outputs = ["native/image-io-build/CMakeFiles/"] +description = "Configure image-io native binaries" + +[feature.native.tasks.build-native-image-io] +cmd = "cmake --build $ITK_WASM_NATIVE_WORKSPACE/image-io-build" +depends-on = ["configure-native-image-io"] +description = "Build image-io native binaries" + +[feature.native.tasks.test-native-image-io] +cmd = "ctest --test-dir $ITK_WASM_NATIVE_WORKSPACE/image-io-build" +depends-on = ["build-native-image-io"] +description = "Test image-io native binaries" + [feature.native.dependencies] cmake = ">=3.30.2,<4" cxx-compiler = ">=1.7.0,<2"