From 1e95429c3fbfb9a30bd8a68e95bce4f882b40aec Mon Sep 17 00:00:00 2001 From: Shenghou Ma Date: Tue, 7 Aug 2012 09:38:35 +0800 Subject: misc/cgo/{life,stdio}, test/run.go: use test/run.go to do the cgo tests Enhances test/run.go to support testing other directories Will enable stdio tests on Windows in a follow-up CL. R=golang-dev, alex.brainman, rsc CC=golang-dev https://golang.org/cl/6220049 --- src/run.bash | 4 ++-- src/run.bat | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/run.bash b/src/run.bash index ca84b7034d..e818e96ecc 100755 --- a/src/run.bash +++ b/src/run.bash @@ -49,12 +49,12 @@ xcd() { [ "$CGO_ENABLED" != 1 ] || [ "$GOHOSTOS" == windows ] || (xcd ../misc/cgo/stdio -./test.bash +go run $GOROOT/test/run.go - . ) || exit $? [ "$CGO_ENABLED" != 1 ] || (xcd ../misc/cgo/life -./test.bash +go run $GOROOT/test/run.go - . ) || exit $? [ "$CGO_ENABLED" != 1 ] || diff --git a/src/run.bat b/src/run.bat index 9a09d435ca..496cbe3d57 100644 --- a/src/run.bat +++ b/src/run.bat @@ -30,6 +30,13 @@ echo. :: at least runtime/debug test will fail. set GOROOT_FINAL= +:: get CGO_ENABLED +go env > env.bat +if errorlevel 1 goto fail +call env.bat +del env.bat +echo. + echo # Testing packages. go test std -short -timeout=120s if errorlevel 1 goto fail @@ -56,6 +63,15 @@ echo. ::if errorlevel 1 goto fail ::echo. +:: cgo tests +:: TODO: Other cgo tests +if x%CGO_ENABLED% == x0 goto nocgo +echo # ..\misc\cgo\life +go run %GOROOT%\test\run.go - ..\misc\cgo\life +if errorlevel 1 goto fail +echo. +:nocgo + :: TODO: The other tests in run.bash. echo # test -- cgit v1.3