]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/go: document changes to go test -c and -o
authorRuss Cox <rsc@golang.org>
Mon, 5 Jun 2023 16:38:59 +0000 (12:38 -0400)
committerRuss Cox <rsc@golang.org>
Tue, 6 Jun 2023 19:24:46 +0000 (19:24 +0000)
This was missing from CL 466397.

For #15513.

Change-Id: I138b7d76842815f4e702d7fe551aa8968097f75b
Reviewed-on: https://go-review.googlesource.com/c/go/+/500955
Reviewed-by: Michael Matloob <matloob@golang.org>
TryBot-Bypass: Russ Cox <rsc@golang.org>

src/cmd/go/alldocs.go
src/cmd/go/internal/test/test.go

index ccf5605a634ce61de3756f291b5d35a614b0c159..bb28756133a50b3f9837573649515d5dc57518ac 100644 (file)
 //         the package list (if present) must appear before this flag.
 //
 //     -c
-//         Compile the test binary to pkg.test but do not run it
+//         Compile the test binary to pkg.test in the current directory but do not run it
 //         (where pkg is the last element of the package's import path).
-//         The file name can be changed with the -o flag.
+//         The file name or target directory can be changed with the -o flag.
 //
 //     -exec xprog
 //         Run the test binary using xprog. The behavior is the same as
 //     -o file
 //         Compile the test binary to the named file.
 //         The test still runs (unless -c or -i is specified).
+//         If file ends in a slash or names an existing directory,
+//         the test is written to pkg.test in that directory.
 //
 // The test binary also accepts flags that control execution of the test; these
 // flags are also accessible by 'go test'. See 'go help testflag' for details.
index cb8cb8370133b7b7da473ef12e575db239d301f6..2ce4c1a28e051fb72f77d79020a8917fe2204cd5 100644 (file)
@@ -145,9 +145,9 @@ In addition to the build flags, the flags handled by 'go test' itself are:
            the package list (if present) must appear before this flag.
 
        -c
-           Compile the test binary to pkg.test but do not run it
+           Compile the test binary to pkg.test in the current directory but do not run it
            (where pkg is the last element of the package's import path).
-           The file name can be changed with the -o flag.
+           The file name or target directory can be changed with the -o flag.
 
        -exec xprog
            Run the test binary using xprog. The behavior is the same as
@@ -160,6 +160,8 @@ In addition to the build flags, the flags handled by 'go test' itself are:
        -o file
            Compile the test binary to the named file.
            The test still runs (unless -c or -i is specified).
+           If file ends in a slash or names an existing directory,
+           the test is written to pkg.test in that directory.
 
 The test binary also accepts flags that control execution of the test; these
 flags are also accessible by 'go test'. See 'go help testflag' for details.