aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test/shell/integration
diff options
context:
space:
mode:
authorGravatar Klaus Aehlig <aehlig@google.com>2017-07-05 10:51:18 -0400
committerGravatar John Cater <jcater@google.com>2017-07-05 13:10:30 -0400
commitea6d06f55e0e2b3ef40ef393993bd83062e73eb7 (patch)
tree14f6e6b1d62dfbeb5878583e26002c64f5446c8f /src/test/shell/integration
parent6ff634d3f3582c74190a5dd5051a4b0253aec604 (diff)
Make integration tests more portable
By avoiding paths that are too specific for a given system, and bringing option arguments before non-option arguments. Change-Id: I82acae94e2d9808c9e81a85018c6a0578da8bd42 PiperOrigin-RevId: 160957203
Diffstat (limited to 'src/test/shell/integration')
-rwxr-xr-xsrc/test/shell/integration/java_integration_test.sh2
-rwxr-xr-xsrc/test/shell/integration/output_filter_test.sh6
-rwxr-xr-xsrc/test/shell/integration/progress_reporting_test.sh2
-rwxr-xr-xsrc/test/shell/integration/run_test.sh6
-rwxr-xr-xsrc/test/shell/integration/stub_finds_runfiles_test.sh8
-rwxr-xr-xsrc/test/shell/integration/test_test.sh4
6 files changed, 14 insertions, 14 deletions
diff --git a/src/test/shell/integration/java_integration_test.sh b/src/test/shell/integration/java_integration_test.sh
index 7c4f5d250f..82e0bb3efb 100755
--- a/src/test/shell/integration/java_integration_test.sh
+++ b/src/test/shell/integration/java_integration_test.sh
@@ -373,7 +373,7 @@ function test_building_deploy_jar_twice_does_not_rebuild() {
write_hello_library_files "$pkg"
bazel build //$pkg/java/main:main_deploy.jar || fail "build failed"
- touch old -r ${PRODUCT_NAME}-bin/$pkg/java/main/main_deploy.jar
+ touch -r ${PRODUCT_NAME}-bin/$pkg/java/main/main_deploy.jar old
bazel build //$pkg/java/main:main_deploy.jar || fail "build failed"
find ${PRODUCT_NAME}-bin/$pkg/java/main/main_deploy.jar -newer old \
| grep -q . && fail "file was rebuilt"
diff --git a/src/test/shell/integration/output_filter_test.sh b/src/test/shell/integration/output_filter_test.sh
index 7b82ec70e3..3d15b7f654 100755
--- a/src/test/shell/integration/output_filter_test.sh
+++ b/src/test/shell/integration/output_filter_test.sh
@@ -127,7 +127,7 @@ sh_test(name='test',
EOF
cat >foo/bar/test.sh <<EOF
-#!/bin/bash
+#!/bin/sh
exit 0
EOF
@@ -226,13 +226,13 @@ sh_test(name='hummingbird', srcs=['hummingbird.sh'])
EOF
cat >geflugel/mockingbird.sh <<EOF
-#!/bin/bash
+#!/bin/sh
echo "To kill -9 a mockingbird"
exit 1
EOF
cat >geflugel/hummingbird.sh <<EOF
-#!/bin/bash
+#!/bin/sh
echo "To kill -9 a hummingbird"
exit 1
EOF
diff --git a/src/test/shell/integration/progress_reporting_test.sh b/src/test/shell/integration/progress_reporting_test.sh
index ab98672cae..b42e28ec46 100755
--- a/src/test/shell/integration/progress_reporting_test.sh
+++ b/src/test/shell/integration/progress_reporting_test.sh
@@ -150,7 +150,7 @@ EOF
# implementation to have a progress message, because it breaks all kinds of
# things.
cat >"${pkg}/workspace_status.sh" <<EOF
-#!/bin/bash
+#!/bin/sh
sleep 5
EOF
diff --git a/src/test/shell/integration/run_test.sh b/src/test/shell/integration/run_test.sh
index b322c858bc..664198c954 100755
--- a/src/test/shell/integration/run_test.sh
+++ b/src/test/shell/integration/run_test.sh
@@ -177,7 +177,7 @@ function test_interrupt_kills_child() {
rm -f "$pipe_file"
mkfifo "$pipe_file" || fail "make pipe failed"
echo 'sh_binary(name = "sleep-minute", srcs = ["sleep-minute.sh"])' > foo/BUILD
- echo -e "#!/bin/bash\n"'echo $$ >'"${pipe_file}\n"'sleep 60' > foo/sleep-minute.sh
+ echo -e "#!/bin/sh\n"'echo $$ >'"${pipe_file}\n"'sleep 60' > foo/sleep-minute.sh
chmod +x foo/sleep-minute.sh
# Note that if bazel info is not executed before the actual bazel run, this script would have to
# be run in "monitor mode" (with the command set -m) for bazel or the server to receive SIGINT.
@@ -293,7 +293,7 @@ sh_binary(
EOF
cat > some/testing/test.sh <<'EOF'
-#!/bin/bash
+#!/usr/bin/env bash
set -ex
echo "Got $@"
i=1
@@ -319,7 +319,7 @@ alias(name='b', actual='a')
EOF
cat > a/a.sh <<EOF
-#!/bin/bash
+#!/bin/sh
echo "Dancing with wolves"
exit 0
EOF
diff --git a/src/test/shell/integration/stub_finds_runfiles_test.sh b/src/test/shell/integration/stub_finds_runfiles_test.sh
index a608625fa2..fe366bd519 100755
--- a/src/test/shell/integration/stub_finds_runfiles_test.sh
+++ b/src/test/shell/integration/stub_finds_runfiles_test.sh
@@ -76,19 +76,19 @@ EOF
touch pkg/pybin.py
touch pkg/pytest.py
cat > pkg/sh_runs_javabin.sh << 'EOF'
-#!/bin/bash
+#!/bin/sh
exec $0.runfiles/*/pkg/javabin
EOF
cat > pkg/sh_runs_javatest.sh << 'EOF'
-#!/bin/bash
+#!/bin/sh
exec $TEST_SRCDIR/*/pkg/javatest
EOF
cat > pkg/sh_runs_pybin.sh << 'EOF'
-#!/bin/bash
+#!/bin/sh
exec $0.runfiles/*/pkg/pybin
EOF
cat > pkg/sh_runs_pytest.sh << 'EOF'
-#!/bin/bash
+#!/bin/sh
exec $TEST_SRCDIR/*/pkg/pytest
EOF
chmod +x pkg/*.sh
diff --git a/src/test/shell/integration/test_test.sh b/src/test/shell/integration/test_test.sh
index f41a36bf7b..7483ca0081 100755
--- a/src/test/shell/integration/test_test.sh
+++ b/src/test/shell/integration/test_test.sh
@@ -32,7 +32,7 @@ sh_test(
)
EOF
cat >tests/success.sh <<'EOF'
-#!/bin/bash
+#!/bin/sh
echo "success.sh is successful"
exit 0
@@ -55,7 +55,7 @@ sh_test(
)
EOF
cat >tests/fail.sh <<'EOF'
-#!/bin/bash
+#!/bin/sh
echo "fail.sh is failing"
exit 42