aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/test
diff options
context:
space:
mode:
authorGravatar John Cater <jcater@google.com>2017-09-20 19:59:03 +0200
committerGravatar László Csomor <laszlocsomor@google.com>2017-09-21 11:02:48 +0200
commit9aafbb7c02f382cd237612ed6e02ac4dab0eaddc (patch)
tree302696c8a56c0dc5a7345b772f3fcf290f89cdb1 /src/test
parentcfbb869911f40c9d8471f8e690eb2a22e2308a37 (diff)
Fix unittest.bash to get the correct TEST_script path.
Change-Id: Ia250c322353638928747d99fbfdb62808a2fd838 PiperOrigin-RevId: 169417597
Diffstat (limited to 'src/test')
-rw-r--r--src/test/shell/unittest.bash6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/test/shell/unittest.bash b/src/test/shell/unittest.bash
index ab03b6587f..b1e606b238 100644
--- a/src/test/shell/unittest.bash
+++ b/src/test/shell/unittest.bash
@@ -284,7 +284,11 @@ TEST_verbose="true" # Whether or not to be verbose. A
# command; "true" or "false" are
# acceptable. The default is: true.
-TEST_script="$(pwd)/$0" # Full path to test script
+TEST_script="$0" # Full path to test script
+# Check if the script path is absolute, if not prefix the PWD.
+if [[ ! "$TEST_script" = /* ]]; then
+ TEST_script="$(pwd)/$0"
+fi
#### Internal functions