exec.test

==== exec-4.2 redirecting output and stderr to file FAILED
==== Contents of test case:

    list [exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2" >&$path(gorp.file)]  [exec [interpreter] $path(cat) $path(gorp.file)]

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
{} {foo bar}
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-4.2 FAILED


==== exec-4.3 redirecting output and stderr to file FAILED
==== Contents of test case:

    exec [interpreter] $path(echo) "first line" > $path(gorp.file)
    list [exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2" >>&$path(gorp.file)]  [exec [interpreter] $path(cat) $path(gorp.file)]

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
{} {first line
foo bar}
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-4.3 FAILED


==== exec-4.5 redirecting output and stderr to file FAILED
==== Contents of test case:

    set f [open $path(gorp.file) w]
    puts $f "Line 1"
    flush $f
    exec >&@ $f [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2"
    exec >&@$f [interpreter] $path(sh) -c "$path(echo) xyzzy 1>&2"
    puts $f "Line 3"
    close $f
    exec [interpreter] $path(cat) $path(gorp.file)

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
Line 1
foo bar
xyzzy
Line 3
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-4.5 FAILED


==== exec-6.1 redirecting stderr through a pipeline FAILED
==== Contents of test case:

    exec [interpreter] $path(sh) -c "$path(echo) foo bar" |& [interpreter] $path(cat)

---- Result was:
invalid command name "stderr32"
    while executing
"stderr32"
    (file "C:/Documents" line 1)
child process exited abnormally
    while executing
"exec >@stdout 2>@stderr C:/DOCUME~1/kennykb/MYDOCU~1/SourceForge/tcl/win/Release/tcltest.exe C:/Documents and Settings/kennykb/My Documents/SourceForg..."
    ("eval" body line 1)
    invoked from within
"eval exec >@stdout 2>@stderr [list [info nameofexecutable]] $newcmd"
    ("foreach" body line 3)
    invoked from within
"foreach arg $cmd {
	if {$arg == ";"} {
	    eval exec >@stdout 2>@stderr [list [info nameofexecutable]] $newcmd
	    set newcmd {}
	    continue
	}
	i..."
    (file "C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/sh" line 10)
child process exited abnormally
---- Result should have been (exact matching):
foo bar
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-6.1 FAILED


==== exec-6.2 redirecting stderr through a pipeline FAILED
==== Contents of test case:

    exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2" |& [interpreter] $path(cat)

---- Result was:
invalid command name "stderr32"
    while executing
"stderr32"
    (file "C:/Documents" line 1)
child process exited abnormally
    while executing
"exec >@stdout 2>@stderr C:/DOCUME~1/kennykb/MYDOCU~1/SourceForge/tcl/win/Release/tcltest.exe C:/Documents and Settings/kennykb/My Documents/SourceForg..."
    ("eval" body line 1)
    invoked from within
"eval exec >@stdout 2>@stderr [list [info nameofexecutable]] $newcmd"
    ("foreach" body line 3)
    invoked from within
"foreach arg $cmd {
	if {$arg == ";"} {
	    eval exec >@stdout 2>@stderr [list [info nameofexecutable]] $newcmd
	    set newcmd {}
	    continue
	}
	i..."
    (file "C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/sh" line 10)
child process exited abnormally
---- Result should have been (exact matching):
foo bar
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-6.2 FAILED


==== exec-6.3 redirecting stderr through a pipeline FAILED
==== Contents of test case:

    exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2"  |& [interpreter] $path(sh) -c "$path(echo) second msg 1>&2 ; $path(cat)" |& [interpreter] $path(cat)

---- Result was:
invalid command name "stderr32"
    while executing
"stderr32"
    (file "C:/Documents" line 1)
child process exited abnormally
    while executing
"exec >@stdout 2>@stderr C:/DOCUME~1/kennykb/MYDOCU~1/SourceForge/tcl/win/Release/tcltest.exe C:/Documents and Settings/kennykb/My Documents/SourceForg..."
    ("eval" body line 1)
    invoked from within
"eval exec >@stdout 2>@stderr [list [info nameofexecutable]] $newcmd"
    ("foreach" body line 3)
    invoked from within
"foreach arg $cmd {
	if {$arg == ";"} {
	    eval exec >@stdout 2>@stderr [list [info nameofexecutable]] $newcmd
	    set newcmd {}
	    continue
	}
	i..."
    (file "C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/sh" line 10)
child process exited abnormally
---- Result should have been (exact matching):
second msg
foo bar
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-6.3 FAILED


==== exec-9.6 commands returning errors FAILED
==== Contents of test case:

    list [catch {exec [interpreter] $path(sh) -c "$path(echo) error msg 1>&2"} msg] $msg

---- Result was:
1 invalid\ command\ name\ \"stderr32\"\n\ \ \ \ while\ executing\n\"stderr32\"\n\ \ \ \ (file\ \"C:/Documents\"\ line\ 1)\nchild\ process\ exited\ abnormally\n\ \ \ \ while\ executing\n\"exec\ >@stdout\ 2>@stderr\ C:/DOCUME~1/kennykb/MYDOCU~1/SourceForge/tcl/win/Release/tcltest.exe\ C:/Documents\ and\ Settings/kennykb/My\ Documents/SourceForg...\"\n\ \ \ \ (\"eval\"\ body\ line\ 1)\n\ \ \ \ invoked\ from\ within\n\"eval\ exec\ >@stdout\ 2>@stderr\ \[list\ \[info\ nameofexecutable\]\]\ \$newcmd\"\n\ \ \ \ (\"foreach\"\ body\ line\ 3)\n\ \ \ \ invoked\ from\ within\n\"foreach\ arg\ \$cmd\ \{\n\tif\ \{\$arg\ ==\ \"\;\"\}\ \{\n\t\ \ \ \ eval\ exec\ >@stdout\ 2>@stderr\ \[list\ \[info\ nameofexecutable\]\]\ \$newcmd\n\t\ \ \ \ set\ newcmd\ \{\}\n\t\ \ \ \ continue\n\t\}\n\ti...\"\n\ \ \ \ (file\ \"C:/Documents\ and\ Settings/kennykb/My\ Documents/SourceForge/tcl/win/sh\"\ line\ 10)
---- Result should have been (exact matching):
1 {error msg}
==== exec-9.6 FAILED


==== exec-9.7 commands returning errors FAILED
==== Contents of test case:

    list [catch {exec [interpreter] $path(sh) -c "$path(echo) error msg 1>&2"  | [interpreter] $path(sh) -c "$path(echo) error msg 1>&2"} msg] $msg

---- Result was:
1 invalid\ command\ name\ \"stderr32\"\n\ \ \ \ while\ executing\n\"stderr32\"\n\ \ \ \ (file\ \"C:/Documents\"\ line\ 1)\nchild\ process\ exited\ abnormally\n\ \ \ \ while\ executing\n\"exec\ >@stdout\ 2>@stderr\ C:/DOCUME~1/kennykb/MYDOCU~1/SourceForge/tcl/win/Release/tcltest.exe\ C:/Documents\ and\ Settings/kennykb/My\ Documents/SourceForg...\"\n\ \ \ \ (\"eval\"\ body\ line\ 1)\n\ \ \ \ invoked\ from\ within\n\"eval\ exec\ >@stdout\ 2>@stderr\ \[list\ \[info\ nameofexecutable\]\]\ \$newcmd\"\n\ \ \ \ (\"foreach\"\ body\ line\ 3)\n\ \ \ \ invoked\ from\ within\n\"foreach\ arg\ \$cmd\ \{\n\tif\ \{\$arg\ ==\ \"\;\"\}\ \{\n\t\ \ \ \ eval\ exec\ >@stdout\ 2>@stderr\ \[list\ \[info\ nameofexecutable\]\]\ \$newcmd\n\t\ \ \ \ set\ newcmd\ \{\}\n\t\ \ \ \ continue\n\t\}\n\ti...\"\n\ \ \ \ (file\ \"C:/Documents\ and\ Settings/kennykb/My\ Documents/SourceForge/tcl/win/sh\"\ line\ 10)\ninvalid\ command\ name\ \"stderr32\"\n\ \ \ \ while\ executing\n\"stderr32\"\n\ \ \ \ (file\ \"C:/Documents\"\ line\ 1)\nchild\ process\ exited\ abnormally\n\ \ \ \ while\ executing\n\"exec\ >@stdout\ 2>@stderr\ C:/DOCUME~1/kennykb/MYDOCU~1/SourceForge/tcl/win/Release/tcltest.exe\ C:/Documents\ and\ Settings/kennykb/My\ Documents/SourceForg...\"\n\ \ \ \ (\"eval\"\ body\ line\ 1)\n\ \ \ \ invoked\ from\ within\n\"eval\ exec\ >@stdout\ 2>@stderr\ \[list\ \[info\ nameofexecutable\]\]\ \$newcmd\"\n\ \ \ \ (\"foreach\"\ body\ line\ 3)\n\ \ \ \ invoked\ from\ within\n\"foreach\ arg\ \$cmd\ \{\n\tif\ \{\$arg\ ==\ \"\;\"\}\ \{\n\t\ \ \ \ eval\ exec\ >@stdout\ 2>@stderr\ \[list\ \[info\ nameofexecutable\]\]\ \$newcmd\n\t\ \ \ \ set\ newcmd\ \{\}\n\t\ \ \ \ continue\n\t\}\n\ti...\"\n\ \ \ \ (file\ \"C:/Documents\ and\ Settings/kennykb/My\ Documents/SourceForge/tcl/win/sh\"\ line\ 10)
---- Result should have been (exact matching):
1 {error msg
error msg}
==== exec-9.7 FAILED


==== exec-11.5 commands in background FAILED
==== Contents of test case:

    set f [open $path(gorp.file) w]
    puts $f [format { catch { exec [info nameofexecutable] %s foo & } } $path(echo)]
    close $f
    string compare "foo" [exec [interpreter] $path(gorp.file)]

---- Result was:
invalid command name "stderr32"
    while executing
"stderr32"
    (file "C:/Documents" line 1)
---- Result should have been (exact matching):
0
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-11.5 FAILED


==== exec-15.1 standard error redirection FAILED
==== Contents of test case:

    exec [interpreter] $path(echo) "First line" > $path(gorp.file)
    list [exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2" 2> $path(gorp.file)]  [exec [interpreter] $path(cat) $path(gorp.file)]

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
{} {foo bar}
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-15.1 FAILED


==== exec-15.2 standard error redirection FAILED
==== Contents of test case:

    list [exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2"  | [interpreter] $path(echo) biz baz >$path(gorp.file) 2> $path(gorp.file2)]  [exec [interpreter] $path(cat) $path(gorp.file)]  [exec [interpreter] $path(cat) $path(gorp.file2)]

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
{} {biz baz} {foo bar}
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-15.2 FAILED


==== exec-15.3 standard error redirection FAILED
==== Contents of test case:

    list [exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2"  | [interpreter] $path(echo) biz baz 2>$path(gorp.file) > $path(gorp.file2)]  [exec [interpreter] $path(cat) $path(gorp.file)]  [exec [interpreter] $path(cat) $path(gorp.file2)]

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
{} {foo bar} {biz baz}
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-15.3 FAILED


==== exec-15.4 standard error redirection FAILED
==== Contents of test case:

    set f [open $path(gorp.file) w]
    puts $f "Line 1"
    flush $f
    exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2" 2>@ $f
    puts $f "Line 3"
    close $f
    exec [interpreter] $path(cat) $path(gorp.file)

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
Line 1
foo bar
Line 3
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-15.4 FAILED


==== exec-15.5 standard error redirection FAILED
==== Contents of test case:

    exec [interpreter] $path(echo) "First line" > $path(gorp.file)
    exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2" 2>> $path(gorp.file)
    exec [interpreter] $path(cat) $path(gorp.file)

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
First line
foo bar
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-15.5 FAILED


==== exec-15.6 standard error redirection FAILED
==== Contents of test case:

    exec [interpreter] $path(sh) -c "$path(echo) foo bar 1>&2" > $path(gorp.file2) 2> $path(gorp.file)  >& $path(gorp.file) 2> $path(gorp.file2) | [interpreter] $path(echo) biz baz
    list [exec [interpreter] $path(cat) $path(gorp.file)] [exec [interpreter] $path(cat) $path(gorp.file2)]

---- Result was:
child process exited abnormally
---- Result should have been (exact matching):
{biz baz} {foo bar}
---- Test generated error; Return code was: 1
---- Return code should have been one of: 0 2
==== exec-15.6 FAILED


==== exec-17.1 inheriting standard I/O FAILED
==== Contents of test case:

    set f [open $path(script) w]
    puts $f [format {close stdout
	set f [open %s w]
	catch {exec [info nameofexecutable] %s foobar &}
	exec [info nameofexecutable] %s 2
	close $f
    } $path(gorp.file) $path(echo) $path(sleep)]
    close $f
    catch {exec [interpreter] $path(script)} result
    set f [open $path(gorp.file) r]
    lappend result [read $f]
    close $f
    set result

---- Result was:
wrong # args: should be {open fileName ?access? ?permissions?} while executing {open C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/gorp.file w} invoked from within {set f [open C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/gorp.file w]} (file {C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/script} line 2) {First line
Second line
Third line
}
---- Result should have been (exact matching):
{foobar
}
==== exec-17.1 FAILED

Test file error: error deleting "C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/win/gorp.file": permission denied
    while executing
"file delete $fullName"
    (procedure "removeFile" line 21)
    invoked from within
"removeFile $file"
    ("foreach" body line 2)
    invoked from within
"foreach file {script gorp.file gorp.file2 echo cat wc sh sleep exit err} {
	removeFile $file
}"
    (file "C:/Documents and Settings/kennykb/My Documents/SourceForge/tcl/tests/exec.test" line 600)
