aboutsummaryrefslogtreecommitdiff
path: root/compiler_wrapper/main.go
diff options
context:
space:
mode:
authorTobias Bosch <tbosch@google.com>2019-07-15 12:22:50 -0700
committerTobias Bosch <tbosch@google.com>2019-07-18 09:09:26 +0000
commit3d89c0b95331323feafcf12181f44ca26bdeb96d (patch)
treeebbbb6cdae92f550a642aaf9d3c9f4432bb847db /compiler_wrapper/main.go
parent198a3c9519e5d93ffeb8f5e1b6694c34b178c5c4 (diff)
downloadtoolchain-utils-3d89c0b95331323feafcf12181f44ca26bdeb96d.tar.gz
Create golden tests for sysroot wrapper.
- Golden files can be updated via the new "-updategolden" test flag. - Golden files contain the wrapper command, commands executed by the wrapper stdout, stderr, exitcode of the wrapper - The commands in the golden files are also compared to the old wrapper to make sure they are correct. We are also mocking less things in the old wrapper now, allowing to compare against differnet wrappers via golden tests in the future (e.g. clang_host_wrapper). - Unit tests are no longer diffing against the old wrapper. BUG=chromium:773875 TEST=unit test Change-Id: I0755bfe11cd499474820c9354412d39a0fa04401 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/third_party/toolchain-utils/+/1702633 Tested-by: Tobias Bosch <tbosch@google.com> Reviewed-by: George Burgess <gbiv@chromium.org>
Diffstat (limited to 'compiler_wrapper/main.go')
-rw-r--r--compiler_wrapper/main.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler_wrapper/main.go b/compiler_wrapper/main.go
index 10132543..8cb26158 100644
--- a/compiler_wrapper/main.go
+++ b/compiler_wrapper/main.go
@@ -9,11 +9,14 @@
//
// Test arguments:
// - crosroot: Specifies the ChromeOS toolchain root directory (aka chroot).
-// If this is given, tests will compare the produced commands against the
+// If this is given, golden tests will compare the produced commands against the
// old compiler wrapper.
+// - updategolden: To update the golden results for the wrapper. Without it,
+// the tests will verify that the wrapper output matches the goldens.
+// - rungolden: To filter the golden tests by a regex for the wrapper env, path and args.
//
// Examples:
-// - run all tests and compare output against old compiler wrapper:
+// - run all tests and compare golden output against old compiler wrapper:
// go test third_party/toolchain-utils/compiler_wrapper/ -v --crosroot=$HOME/chromiumos/chroot/
// - run all tests in isolation:
// go test third_party/toolchain-utils/compiler_wrapper/ -v