[TESTS] Import script robustness (set -u) (#2896)
authorMarcus Shawcroft <marcus.shawcroft@arm.com>
Tue, 26 Mar 2019 18:17:11 +0000 (18:17 +0000)
committerTianqi Chen <tqchen@users.noreply.github.com>
Tue, 26 Mar 2019 18:17:11 +0000 (11:17 -0700)
Adopt the "set -u" idiom from the docker scripts as a mechanism to
improve future robustness.

tests/scripts/task_cpp_unittest.sh
tests/scripts/task_golang.sh
tests/scripts/task_java_unittest.sh
tests/scripts/task_python_integration.sh
tests/scripts/task_rust.sh

index c39dcf5..339019b 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/bash
 
 set -e
+set -u
 
-export LD_LIBRARY_PATH=lib:${LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
 
 make cpptest -j8
 for test in build/*_test; do
index 363ee05..672445c 100755 (executable)
@@ -1,8 +1,9 @@
 #!/bin/bash
 
 set -e
+set -u
 
-export LD_LIBRARY_PATH=lib:$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
 
 tvm_root="$(git rev-parse --show-toplevel)"
 export PYTHONPATH="$tvm_root/python":"$tvm_root/nnvm/python":"$tvm_root/topi/python"
index ac98435..fa85f24 100755 (executable)
@@ -1,9 +1,10 @@
 #!/bin/bash
 
 set -e
+set -u
 
 export PYTHONPATH=python
-export LD_LIBRARY_PATH=lib:${LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
 
 CURR_DIR=$(cd `dirname $0`; pwd)
 SCRIPT_DIR=$CURR_DIR/../../jvm/core/src/test/scripts
index d17c8d3..abed38d 100755 (executable)
@@ -1,9 +1,10 @@
 #!/bin/bash
 
 set -e
+set -u
 
 export PYTHONPATH=python:topi/python:apps/extension/python
-export LD_LIBRARY_PATH=build:${LD_LIBRARY_PATH}
+export LD_LIBRARY_PATH="build:${LD_LIBRARY_PATH:-}"
 
 rm -rf python/tvm/*.pyc python/tvm/*/*.pyc python/tvm/*/*/*.pyc
 
index 5d8c242..be0181b 100755 (executable)
@@ -1,10 +1,11 @@
 #!/bin/bash
 
 set -e
+set -u
 
 export TVM_HOME="$(git rev-parse --show-toplevel)"
 
-export LD_LIBRARY_PATH="$TVM_HOME/lib":"$TVM_HOME/build":"$TVM_HOME/nnvm":$LD_LIBRARY_PATH
+export LD_LIBRARY_PATH="$TVM_HOME/lib:$TVM_HOME/build:$TVM_HOME/nnvm:${LD_LIBRARY_PATH:-}"
 export PYTHONPATH="$TVM_HOME/python":"$TVM_HOME/nnvm/python":"$TVM_HOME/topi/python"
 export RUST_DIR="$TVM_HOME/rust"