#! /bin/sh
# If executed as a shell script, the next line replaces the shell \
exec tclsh "$0" ${1+"$@"}

set MyApp {
	interp create child
	proc someProc {} {
		child eval {
			puts "Hi from child."
			puts stderr "Error message from child."
		}
	}
}

package require tcltest 2.2
namespace import -force ::tcltest::*
tcltest::configure -verbose {body pass error}

test someProc-1.1 {capture output from child interp} -setup {
	eval $MyApp
} -body {
	someProc
} -result {} -output "Hi from child.\n" -errorOutput "Error message from child.\n" -cleanup {
	interp delete child
}
tcltest::cleanupTests
