diff --git a/SConstruct b/SConstruct index 785f8a7..4bb873a 100644 --- a/SConstruct +++ b/SConstruct @@ -210,6 +210,7 @@ if env["BOOTDISK"] == "1": Depends(bootdisk, "#build/sys/castor") #Depends(bootdisk, "#build/tests/lwiptest") Depends(bootdisk, "#build/tests/pthreadtest") + Depends(bootdisk, "#build/tests/spawntest") Depends(bootdisk, "#build/tests/threadtest") env.Alias('bootdisk', '#build/bootdisk.img') env.Install('$PREFIX/','#build/bootdisk.img') diff --git a/release/bootdisk.manifest b/release/bootdisk.manifest index 3e85654..bf827bb 100644 --- a/release/bootdisk.manifest +++ b/release/bootdisk.manifest @@ -20,6 +20,7 @@ DIR / END DIR tests FILE pthreadtest build/tests/pthreadtest + FILE spawntest build/tests/spawntest FILE threadtest build/tests/threadtest END FILE LICENSE LICENSE diff --git a/tests/SConscript b/tests/SConscript index 37a6b27..8183fa8 100644 --- a/tests/SConscript +++ b/tests/SConscript @@ -15,6 +15,12 @@ threadtest_src.append(["threadtest.c"]) threadtest_src.append(env["CRTEND"]) test_env.Program("threadtest", threadtest_src) +spawntest_src = [] +spawntest_src.append(env["CRTBEGIN"]) +spawntest_src.append(["spawntest.c"]) +spawntest_src.append(env["CRTEND"]) +test_env.Program("spawntest", spawntest_src) + pthreadtest_src = [] pthreadtest_src.append(env["CRTBEGIN"]) pthreadtest_src.append(["pthreadtest.c"]) diff --git a/tests/spawntest.c b/tests/spawntest.c index 51555a7..fa4e7c7 100644 --- a/tests/spawntest.c +++ b/tests/spawntest.c @@ -13,18 +13,22 @@ main(int argc, const char *argv[]) int status[10]; printf("Spawn test: "); - for (int i = 0; i < 10; i++) { + for (int i = 0; i < 100; i++) { status[0] = OSSpawn("/bin/echo", &argv[0]); - OSWait(status[0]); + printf("spawn: %lx\n", status[0]); + status[0] = OSWait(status[0]); + printf("wait: %lx\n", status[0]); } printf("Success!\n"); - printf("Spawn parallel test: "); + printf("Spawn parallel test wait any: "); for (int i = 0; i < 10; i++) { status[i] = OSSpawn("/bin/echo", &argv[0]); + printf("spawn: %lx\n", status[i]); } for (int i = 0; i < 10; i++) { - OSWait(0); + status[i] = OSWait(0); + printf("wait: %lx\n", status[i]); } printf("Success!\n");