From 3d84d17cc6fe1521b267cecf80316060ae4ffc52 Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Wed, 4 Feb 2009 13:28:19 -0600 Subject: [PATCH] use the console factor for tests --- basis/io/launcher/windows/nt/nt-tests.factor | 25 +++++++++++--------- 1 file changed, 14 insertions(+), 11 deletions(-) diff --git a/basis/io/launcher/windows/nt/nt-tests.factor b/basis/io/launcher/windows/nt/nt-tests.factor index 93b1e8c2ff..4dd0eebed3 100644 --- a/basis/io/launcher/windows/nt/nt-tests.factor +++ b/basis/io/launcher/windows/nt/nt-tests.factor @@ -1,7 +1,7 @@ USING: io.launcher tools.test calendar accessors environment namespaces kernel system arrays io io.files io.encodings.ascii sequences parser assocs hashtables math continuations eval -io.files.temp io.directories io.pathnames ; +io.files.temp io.directories io.pathnames splitting ; IN: io.launcher.windows.nt.tests [ ] [ @@ -23,9 +23,12 @@ IN: io.launcher.windows.nt.tests [ f ] [ "notepad" get process-running? ] unit-test +: console-vm ( -- path ) + vm ".exe" ?tail [ ".com" append ] when ; + [ ] [ - vm "-quiet" "-run=hello-world" 3array >>command + console-vm "-quiet" "-run=hello-world" 3array >>command "out.txt" temp-file >>stdout try-process ] unit-test @@ -36,7 +39,7 @@ IN: io.launcher.windows.nt.tests [ ] [ - vm "-run=listener" 2array >>command + console-vm "-run=listener" 2array >>command +closed+ >>stdin try-process ] unit-test @@ -47,7 +50,7 @@ IN: io.launcher.windows.nt.tests [ ] [ launcher-test-path [ - vm "-script" "stderr.factor" 3array >>command + console-vm "-script" "stderr.factor" 3array >>command "out.txt" temp-file >>stdout "err.txt" temp-file >>stderr try-process @@ -65,7 +68,7 @@ IN: io.launcher.windows.nt.tests [ ] [ launcher-test-path [ - vm "-script" "stderr.factor" 3array >>command + console-vm "-script" "stderr.factor" 3array >>command "out.txt" temp-file >>stdout +stdout+ >>stderr try-process @@ -79,7 +82,7 @@ IN: io.launcher.windows.nt.tests [ "output" ] [ launcher-test-path [ - vm "-script" "stderr.factor" 3array >>command + console-vm "-script" "stderr.factor" 3array >>command "err2.txt" temp-file >>stderr ascii lines first ] with-directory @@ -92,7 +95,7 @@ IN: io.launcher.windows.nt.tests [ t ] [ launcher-test-path [ - vm "-script" "env.factor" 3array >>command + console-vm "-script" "env.factor" 3array >>command ascii contents ] with-directory eval @@ -102,7 +105,7 @@ IN: io.launcher.windows.nt.tests [ t ] [ launcher-test-path [ - vm "-script" "env.factor" 3array >>command + console-vm "-script" "env.factor" 3array >>command +replace-environment+ >>environment-mode os-envs >>environment ascii contents @@ -114,7 +117,7 @@ IN: io.launcher.windows.nt.tests [ "B" ] [ launcher-test-path [ - vm "-script" "env.factor" 3array >>command + console-vm "-script" "env.factor" 3array >>command { { "A" "B" } } >>environment ascii contents ] with-directory eval @@ -125,7 +128,7 @@ IN: io.launcher.windows.nt.tests [ f ] [ launcher-test-path [ - vm "-script" "env.factor" 3array >>command + console-vm "-script" "env.factor" 3array >>command { { "USERPROFILE" "XXX" } } >>environment +prepend-environment+ >>environment-mode ascii contents @@ -151,7 +154,7 @@ IN: io.launcher.windows.nt.tests 2 [ launcher-test-path [ - vm "-script" "append.factor" 3array >>command + console-vm "-script" "append.factor" 3array >>command "append-test" temp-file >>stdout try-process ] with-directory