diff --git a/tests/spawntest.c b/tests/spawntest.c new file mode 100644 index 0000000..51555a7 --- /dev/null +++ b/tests/spawntest.c @@ -0,0 +1,33 @@ + +#include +#include +#include +#include + +// Castor Only +#include + +int +main(int argc, const char *argv[]) +{ + int status[10]; + + printf("Spawn test: "); + for (int i = 0; i < 10; i++) { + status[0] = OSSpawn("/bin/echo", &argv[0]); + OSWait(status[0]); + } + printf("Success!\n"); + + printf("Spawn parallel test: "); + for (int i = 0; i < 10; i++) { + status[i] = OSSpawn("/bin/echo", &argv[0]); + } + for (int i = 0; i < 10; i++) { + OSWait(0); + } + printf("Success!\n"); + + return 0; +} +