aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorYesudeep Mangalapilly <yesudeep@gmail.com>2021-10-25 06:12:41 -0700
committerGitHub <noreply@github.com>2021-10-25 09:12:41 -0400
commit8e923ca4b9c922420bf460f48f933e9efb4c88d2 (patch)
tree9c9697533000c1d00f98b92eeefb1c6e0607efab /tests
parent506c17293ef4043c68f8cb0ba5fa05d758e1231a (diff)
downloadbazel-skylib-8e923ca4b9c922420bf460f48f933e9efb4c88d2.tar.gz
Use more portable `#!/usr/bin/env bash` shebang instead of hardcoded /bin/bash. (#329)
Diffstat (limited to 'tests')
-rwxr-xr-xtests/analysis_test_test.sh2
-rwxr-xr-xtests/common_settings_test.sh2
-rw-r--r--tests/copy_file/BUILD2
-rw-r--r--tests/copy_file/a.txt2
-rwxr-xr-xtests/copy_file/a_with_exec_bit.txt2
-rwxr-xr-xtests/copy_file/copy_file_tests.sh10
-rwxr-xr-xtests/diff_test/diff_test_tests.sh2
-rw-r--r--tests/run_binary/BUILD2
-rw-r--r--tests/shell_tests.bzl2
-rwxr-xr-xtests/unittest.bash4
-rwxr-xr-xtests/unittest_test.sh2
-rw-r--r--tests/write_file/BUILD2
-rwxr-xr-xtests/write_file/write_file_tests.sh2
13 files changed, 18 insertions, 18 deletions
diff --git a/tests/analysis_test_test.sh b/tests/analysis_test_test.sh
index db9bbac..2edae15 100755
--- a/tests/analysis_test_test.sh
+++ b/tests/analysis_test_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2019 The Bazel Authors. All rights reserved.
#
diff --git a/tests/common_settings_test.sh b/tests/common_settings_test.sh
index 531e830..1e3d03d 100755
--- a/tests/common_settings_test.sh
+++ b/tests/common_settings_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2019 The Bazel Authors. All rights reserved.
#
diff --git a/tests/copy_file/BUILD b/tests/copy_file/BUILD
index cacb5b1..2e6914c 100644
--- a/tests/copy_file/BUILD
+++ b/tests/copy_file/BUILD
@@ -169,5 +169,5 @@ copy_file(
genrule(
name = "gen",
outs = ["b.txt"],
- cmd = "echo -e '#!/bin/bash\necho potato' > $@",
+ cmd = "echo -e '#!/usr/bin/env bash\necho potato' > $@",
)
diff --git a/tests/copy_file/a.txt b/tests/copy_file/a.txt
index acd332a..37b2322 100644
--- a/tests/copy_file/a.txt
+++ b/tests/copy_file/a.txt
@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env bash
echo aaa
diff --git a/tests/copy_file/a_with_exec_bit.txt b/tests/copy_file/a_with_exec_bit.txt
index acd332a..37b2322 100755
--- a/tests/copy_file/a_with_exec_bit.txt
+++ b/tests/copy_file/a_with_exec_bit.txt
@@ -1,2 +1,2 @@
-#!/bin/bash
+#!/usr/bin/env bash
echo aaa
diff --git a/tests/copy_file/copy_file_tests.sh b/tests/copy_file/copy_file_tests.sh
index 90d79ee..737afd7 100755
--- a/tests/copy_file/copy_file_tests.sh
+++ b/tests/copy_file/copy_file_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2019 The Bazel Authors. All rights reserved.
#
@@ -42,25 +42,25 @@ source "$(rlocation bazel_skylib/tests/unittest.bash)" \
function test_copy_src() {
cat "$(rlocation bazel_skylib/tests/copy_file/out/a-out.txt)" >"$TEST_log"
- expect_log '^#!/bin/bash$'
+ expect_log '^#!/usr/bin/env bash$'
expect_log '^echo aaa$'
}
function test_copy_src_symlink() {
cat "$(rlocation bazel_skylib/tests/copy_file/out/a-out-symlink.txt)" >"$TEST_log"
- expect_log '^#!/bin/bash$'
+ expect_log '^#!/usr/bin/env bash$'
expect_log '^echo aaa$'
}
function test_copy_gen() {
cat "$(rlocation bazel_skylib/tests/copy_file/out/gen-out.txt)" >"$TEST_log"
- expect_log '^#!/bin/bash$'
+ expect_log '^#!/usr/bin/env bash$'
expect_log '^echo potato$'
}
function test_copy_gen_symlink() {
cat "$(rlocation bazel_skylib/tests/copy_file/out/gen-out-symlink.txt)" >"$TEST_log"
- expect_log '^#!/bin/bash$'
+ expect_log '^#!/usr/bin/env bash$'
expect_log '^echo potato$'
}
diff --git a/tests/diff_test/diff_test_tests.sh b/tests/diff_test/diff_test_tests.sh
index 5af60aa..4b58e6c 100755
--- a/tests/diff_test/diff_test_tests.sh
+++ b/tests/diff_test/diff_test_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2019 The Bazel Authors. All rights reserved.
#
diff --git a/tests/run_binary/BUILD b/tests/run_binary/BUILD
index f511c03..85c10f3 100644
--- a/tests/run_binary/BUILD
+++ b/tests/run_binary/BUILD
@@ -82,7 +82,7 @@ write_file(
"@echo>>%OUT% ENV_PATH_CMD=(%ENV_PATH_CMD%)",
],
"//conditions:default": [
- "#!/bin/bash",
+ "#!/usr/bin/env bash",
"echo > \"$OUT\" \"arg1=($1)\"",
"echo >> \"$OUT\" \"arg2=($2)\"",
"echo >> \"$OUT\" \"ENV_LOCATION=($ENV_LOCATION)\"",
diff --git a/tests/shell_tests.bzl b/tests/shell_tests.bzl
index 32d517f..5b83f9f 100644
--- a/tests/shell_tests.bzl
+++ b/tests/shell_tests.bzl
@@ -69,7 +69,7 @@ def _shell_args_test_gen_impl(ctx):
"back`echo q`uote",
]
script_content = "\n".join([
- "#!/bin/bash",
+ "#!/usr/bin/env bash",
"myarray=" + shell.array_literal(args),
'output=$(echo "${myarray[@]}")',
# For logging:
diff --git a/tests/unittest.bash b/tests/unittest.bash
index 3bd07c7..a43678d 100755
--- a/tests/unittest.bash
+++ b/tests/unittest.bash
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
#
# Copyright 2015 The Bazel Authors. All rights reserved.
#
@@ -21,7 +21,7 @@
# A typical test suite looks like so:
#
# ------------------------------------------------------------------------
-# #!/bin/bash
+# #!/usr/bin/env bash
#
# source path/to/unittest.bash || exit 1
#
diff --git a/tests/unittest_test.sh b/tests/unittest_test.sh
index 1d941b3..4795b7e 100755
--- a/tests/unittest_test.sh
+++ b/tests/unittest_test.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2019 The Bazel Authors. All rights reserved.
#
diff --git a/tests/write_file/BUILD b/tests/write_file/BUILD
index 9ea3609..e4f2a94 100644
--- a/tests/write_file/BUILD
+++ b/tests/write_file/BUILD
@@ -113,7 +113,7 @@ write_file(
name = "write_nonempty_bin",
out = "out/nonempty.sh",
content = [
- "#!/bin/bash",
+ "#!/usr/bin/env bash",
"echo potato",
],
is_executable = True,
diff --git a/tests/write_file/write_file_tests.sh b/tests/write_file/write_file_tests.sh
index 0f48ca0..e7039d0 100755
--- a/tests/write_file/write_file_tests.sh
+++ b/tests/write_file/write_file_tests.sh
@@ -1,4 +1,4 @@
-#!/bin/bash
+#!/usr/bin/env bash
# Copyright 2019 The Bazel Authors. All rights reserved.
#