: arch-temp-file ( str -- str' )
"-" my-arch 3append temp-file ;
-[ ] [
+{ } [
[ "launcher-test-1" arch-temp-file delete-file ] ignore-errors
] unit-test
-[ ] [
+{ } [
"touch"
"launcher-test-1" arch-temp-file
2array
try-process
] unit-test
-[ t ] [ "launcher-test-1" arch-temp-file exists? ] unit-test
+{ t } [ "launcher-test-1" arch-temp-file exists? ] unit-test
-[ ] [
+{ } [
[ "launcher-test-1" arch-temp-file delete-file ] ignore-errors
] unit-test
-[ ] [
+{ } [
<process>
"echo Hello" >>command
"launcher-test-1" arch-temp-file >>stdout
try-process
] unit-test
-[ "Hello\n" ] [
+{ "Hello\n" } [
"cat"
"launcher-test-1" arch-temp-file
2array
ascii <process-reader> stream-contents
] unit-test
-[ ] [
+{ } [
[ "launcher-test-1" arch-temp-file delete-file ] ignore-errors
] unit-test
-[ ] [
+{ } [
<process>
"cat" >>command
+closed+ >>stdin
try-process
] unit-test
-[ "" ] [
+{ "" } [
"cat"
"launcher-test-1" arch-temp-file
2array
ascii <process-reader> stream-contents
] unit-test
-[ ] [
+{ } [
2 [
"launcher-test-1" arch-temp-file binary <file-appender> [
<process>
] times
] unit-test
-[ "Hello\nHello\n" ] [
+{ "Hello\nHello\n" } [
"cat"
"launcher-test-1" arch-temp-file
2array
ascii <process-reader> stream-contents
] unit-test
-[ t ] [
+{ t } [
<process>
"env" >>command
{ { "A" "B" } } >>environment
"A=B" swap member?
] unit-test
-[ { "A=B" } ] [
+{ { "A=B" } } [
<process>
"env" >>command
{ { "A" "B" } } >>environment
ascii <process-reader> stream-lines
] unit-test
-[ "hi\n" ] [
+{ "hi\n" } [
temp-directory [
[ "aloha" delete-file ] ignore-errors
<process>
[ "append-test" arch-temp-file delete-file ] ignore-errors
-[ "hi\nhi\n" ] [
+{ "hi\nhi\n" } [
2 [
<process>
"echo hi" >>command
"append-test" arch-temp-file utf8 file-contents
] unit-test
-[ t ] [ "ls" utf8 <process-stream> stream-contents >boolean ] unit-test
+{ t } [ "ls" utf8 <process-stream> stream-contents >boolean ] unit-test
-[ "Hello world.\n" ] [
+{ "Hello world.\n" } [
"cat" utf8 <process-stream> [
"Hello world.\n" write
output-stream get dispose
] [ io-timeout? ] must-fail-with
! Killed processes were exiting with code 0 on FreeBSD
-[ f ] [
+[ f ] {
[let
<promise> :> p
<promise> :> s
p 1 seconds ?promise-timeout (kill-process)
s 3 seconds ?promise-timeout 0 =
- ]
+ }
] unit-test
! Make sure that subprocesses don't inherit our signal mask
"SIGPIPE" signal-names index 1 +
kill io-error ;
-[ ] [ (current-process) send-sigpipe ] unit-test
+{ } [ (current-process) send-sigpipe ] unit-test
! Spawn a process
-[ T{ signal f 13 } ] [
+{ T{ signal f 13 } } [
"sleep 1000" run-detached
1 seconds sleep
[ handle>> send-sigpipe ]
] unit-test
! Test priority
-[ 0 ] [
+{ 0 } [
<process>
{ "bash" "-c" "sleep 2&" } >>command
+low-priority+ >>priority