aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/testdata/script
diff options
context:
space:
mode:
authorThan McIntosh <thanm@google.com>2024-07-26 12:58:29 +0000
committerThan McIntosh <thanm@google.com>2024-07-29 16:13:19 +0000
commitaa97a012b4be393c1725c16a78b92dea81632378 (patch)
tree79da288905fa7c3d60fa3af932aac6d86ed0ec38 /src/cmd/compile/testdata/script
parentf021221a584ede27c18f0e7deb90c438649d5128 (diff)
downloadgo-aa97a012b4be393c1725c16a78b92dea81632378.tar.xz
cmd/compile: add script testing facility for compiler use
Add support for running script tests as part of the compiler's suite of tests, hooking in the script test engine packages recently moved from cmd/go to cmd/internal. These script tests will use the test binary itself as the compile tool for Go builds, and can also run the C compiler if needed. New script test cases (*.txt files) should be added to the directory cmd/compile/testdata/script. Updates #68606. Change-Id: I9b056a07024b0a72320a89ad734e4b4a51f1c10c Reviewed-on: https://go-review.googlesource.com/c/go/+/601361 Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: David Chase <drchase@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Diffstat (limited to 'src/cmd/compile/testdata/script')
-rw-r--r--src/cmd/compile/testdata/script/script_test_basics.txt24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/cmd/compile/testdata/script/script_test_basics.txt b/src/cmd/compile/testdata/script/script_test_basics.txt
new file mode 100644
index 0000000000..ecc28951a1
--- /dev/null
+++ b/src/cmd/compile/testdata/script/script_test_basics.txt
@@ -0,0 +1,24 @@
+
+# Test of the linker's script test harness.
+
+go build
+[!cgo] skip
+cc -c testdata/mumble.c
+
+-- go.mod --
+module main
+
+go 1.20
+
+-- main.go --
+package main
+
+func main() {
+ println("Hi mom!")
+}
+
+-- testdata/mumble.c --
+
+int x;
+
+