From aa97a012b4be393c1725c16a78b92dea81632378 Mon Sep 17 00:00:00 2001 From: Than McIntosh Date: Fri, 26 Jul 2024 12:58:29 +0000 Subject: 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 Reviewed-by: David Chase LUCI-TryBot-Result: Go LUCI --- .../compile/testdata/script/script_test_basics.txt | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 src/cmd/compile/testdata/script/script_test_basics.txt (limited to 'src/cmd/compile/testdata/script') 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; + + -- cgit v1.3-5-g9baa