diff options
author | 2016-12-08 19:53:41 +0000 | |
---|---|---|
committer | 2016-12-09 15:32:55 +0000 | |
commit | 25120df651ae7d0ac9e85cbbea54921d1f2c4ae4 (patch) | |
tree | f0938c8db71c6e4b2684befdb88fa6023cc85155 /tools/test/test-setup.sh | |
parent | 38edc5dc9d1fd58ffcb3223a1c194e04eb066437 (diff) |
Initial code for Persistent Java Test Runner.
At this point this does nothing more than re-run the exact same test without having to re-start the test runner.
In future iterations the aim is to be able to re-run tests with modified code, without having to re-start the test runner.
To test out the WorkerTestStrategy simply use --test_strategy=experimental_worker for a test with bazel.
--
PiperOrigin-RevId: 141465929
MOS_MIGRATED_REVID=141465929
Diffstat (limited to 'tools/test/test-setup.sh')
-rwxr-xr-x | tools/test/test-setup.sh | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/tools/test/test-setup.sh b/tools/test/test-setup.sh index d7bb6c374d..47666d688f 100755 --- a/tools/test/test-setup.sh +++ b/tools/test/test-setup.sh @@ -17,8 +17,15 @@ # shift stderr to stdout. exec 2>&1 -# Executing the test log will page it. -echo 'exec ${PAGER:-/usr/bin/less} "$0" || exit 1' +no_echo= +if [[ "$1" = "--no_echo" ]]; then + # Don't print anything to stdout in this special case. + # Currently needed for persistent test runner. + no_echo="true" + shift +else + echo 'exec ${PAGER:-/usr/bin/less} "$0" || exit 1' +fi # Bazel sets some environment vars to relative paths, but it's easier to deal # with absolute paths once we're actually running the test, so let's convert @@ -84,7 +91,9 @@ if [ -z "$COVERAGE_DIR" ]; then fi # This header marks where --test_output=streamed will start being printed. -echo "-----------------------------------------------------------------------------" +if [[ -z "$no_echo" ]]; then + echo "-----------------------------------------------------------------------------" +fi # The path of this command-line is usually relative to the exec-root, # but when using --run_under it can be a "/bin/bash -c" command-line. |