tg.grepStderr("^hello world", `ldflags -X "main.extern=hello world"' failed`)
}
-func TestGoTestCpuprofileLeavesBinaryBehind(t *testing.T) {
- skipIfGccgo(t, "gccgo has no standard packages")
- tooSlow(t)
- tg := testgo(t)
- defer tg.cleanup()
- // TODO: tg.parallel()
- tg.makeTempdir()
- tg.cd(tg.path("."))
- tg.run("test", "-cpuprofile", "errors.prof", "errors")
- tg.wantExecutable("errors.test"+exeSuffix, "go test -cpuprofile did not create errors.test")
-}
-
-func TestGoTestCpuprofileDashOControlsBinaryLocation(t *testing.T) {
- skipIfGccgo(t, "gccgo has no standard packages")
- tooSlow(t)
- tg := testgo(t)
- defer tg.cleanup()
- // TODO: tg.parallel()
- tg.makeTempdir()
- tg.cd(tg.path("."))
- tg.run("test", "-cpuprofile", "errors.prof", "-o", "myerrors.test"+exeSuffix, "errors")
- tg.wantExecutable("myerrors.test"+exeSuffix, "go test -cpuprofile -o myerrors.test did not create myerrors.test")
-}
-
-func TestGoTestMutexprofileLeavesBinaryBehind(t *testing.T) {
- skipIfGccgo(t, "gccgo has no standard packages")
- tooSlow(t)
- tg := testgo(t)
- defer tg.cleanup()
- // TODO: tg.parallel()
- tg.makeTempdir()
- tg.cd(tg.path("."))
- tg.run("test", "-mutexprofile", "errors.prof", "errors")
- tg.wantExecutable("errors.test"+exeSuffix, "go test -mutexprofile did not create errors.test")
-}
-
-func TestGoTestMutexprofileDashOControlsBinaryLocation(t *testing.T) {
- skipIfGccgo(t, "gccgo has no standard packages")
- tooSlow(t)
- tg := testgo(t)
- defer tg.cleanup()
- // TODO: tg.parallel()
- tg.makeTempdir()
- tg.cd(tg.path("."))
- tg.run("test", "-mutexprofile", "errors.prof", "-o", "myerrors.test"+exeSuffix, "errors")
- tg.wantExecutable("myerrors.test"+exeSuffix, "go test -mutexprofile -o myerrors.test did not create myerrors.test")
-}
-
func TestGoTestDashCDashOControlsBinaryLocation(t *testing.T) {
skipIfGccgo(t, "gccgo has no standard packages")
tooSlow(t)
--- /dev/null
+[gccgo] skip 'gccgo has no standard packages'
+[short] skip
+
+# Check go test -cpuprofile creates errors.test
+go test -cpuprofile errors.prof errors
+exists -exec errors.test$GOEXE
+
+# Check go test -cpuprofile -o myerrors.test creates errors.test
+go test -cpuprofile errors.prof -o myerrors.test$GOEXE errors
+exists -exec myerrors.test$GOEXE
+
+# Check go test -mutexprofile creates errors.test
+go test -mutexprofile errors.prof errors
+exists -exec errors.test$GOEXE
+
+# Check go test -mutexprofile -o myerrors.test creates errors.test
+go test -mutexprofile errors.prof -o myerrors.test$GOEXE errors
+exists -exec myerrors.test$GOEXE
+