Skip to content

Commit 52a1c09

Browse files
committed
test(pthreads-test): use standard --threads flag
1 parent bef3f57 commit 52a1c09

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

packages/core/typescript/itk-wasm/test/node/pipeline/run-pipeline-node-test.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import {
1010
InterfaceTypes
1111
} from '../../../dist/index-node.js'
1212

13-
function readCthead1 () {
13+
function readCthead1() {
1414
const testInputImageDir = path.resolve(
1515
'test',
1616
'pipelines',
@@ -49,7 +49,7 @@ function readCthead1 () {
4949
return image
5050
}
5151

52-
function readCow () {
52+
function readCow() {
5353
const testInputMeshDir = path.resolve(
5454
'test',
5555
'pipelines',
@@ -88,7 +88,7 @@ function readCow () {
8888
return mesh
8989
}
9090

91-
function readLinearTransform () {
91+
function readLinearTransform() {
9292
const testInputTransformDir = path.resolve(
9393
'test',
9494
'pipelines',
@@ -126,7 +126,7 @@ function readLinearTransform () {
126126
return transformList
127127
}
128128

129-
function readCompositeTransform () {
129+
function readCompositeTransform() {
130130
const testInputTransformDir = path.resolve(
131131
'test',
132132
'pipelines',
@@ -651,7 +651,7 @@ test('runPipelineNode runs pthreads-enabled pipeline', async (t) => {
651651
'pthreads-pipeline',
652652
'pthreads-test'
653653
)
654-
const args = ['--memory-io', '--number-of-threads', '4', '0']
654+
const args = ['--memory-io', '--threads', '3', '0']
655655
const desiredOutputs = [{ type: InterfaceTypes.JsonCompatible }]
656656
const inputs = []
657657

packages/core/typescript/itk-wasm/test/pipelines/pthreads-pipeline/pthreads-test.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,13 @@ int main( int argc, char * argv[] )
3737
{
3838
itk::wasm::Pipeline pipeline("pthreads-test", "A pipeline to test pthreads support", argc, argv);
3939

40-
int numberOfThreads = 4;
41-
pipeline.add_option("-n,--number-of-threads", numberOfThreads, "The number of threads to use");
42-
4340
itk::wasm::OutputTextStream outputJson;
4441
pipeline.add_option("output-json", outputJson, "The output json with test results")->type_name("OUTPUT_JSON");
4542

4643
ITK_WASM_PARSE(pipeline);
4744

45+
const int numberOfThreads = pipeline.get_threads();
46+
4847
// Based on: https://bytecodealliance.org/articles/wasi-threads
4948
pthread_t threads[512];
5049
size_t thread_ids[512];

0 commit comments

Comments
 (0)