Skip to content

Commit bedc890

Browse files
mshawcroftLaurawly
authored andcommitted
[TESTS] Import script robustness (set -u) (apache#2896)
Adopt the "set -u" idiom from the docker scripts as a mechanism to improve future robustness.
1 parent e3fb049 commit bedc890

File tree

5 files changed

+10
-5
lines changed

5 files changed

+10
-5
lines changed

tests/scripts/task_cpp_unittest.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
22

33
set -e
4+
set -u
45

5-
export LD_LIBRARY_PATH=lib:${LD_LIBRARY_PATH}
6+
export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
67

78
make cpptest -j8
89
for test in build/*_test; do

tests/scripts/task_golang.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
#!/bin/bash
22

33
set -e
4+
set -u
45

5-
export LD_LIBRARY_PATH=lib:$LD_LIBRARY_PATH
6+
export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
67

78
tvm_root="$(git rev-parse --show-toplevel)"
89
export PYTHONPATH="$tvm_root/python":"$tvm_root/nnvm/python":"$tvm_root/topi/python"

tests/scripts/task_java_unittest.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/bin/bash
22

33
set -e
4+
set -u
45

56
export PYTHONPATH=python
6-
export LD_LIBRARY_PATH=lib:${LD_LIBRARY_PATH}
7+
export LD_LIBRARY_PATH="lib:${LD_LIBRARY_PATH:-}"
78

89
CURR_DIR=$(cd `dirname $0`; pwd)
910
SCRIPT_DIR=$CURR_DIR/../../jvm/core/src/test/scripts

tests/scripts/task_python_integration.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
#!/bin/bash
22

33
set -e
4+
set -u
45

56
export PYTHONPATH=python:topi/python:apps/extension/python
6-
export LD_LIBRARY_PATH=build:${LD_LIBRARY_PATH}
7+
export LD_LIBRARY_PATH="build:${LD_LIBRARY_PATH:-}"
78

89
rm -rf python/tvm/*.pyc python/tvm/*/*.pyc python/tvm/*/*/*.pyc
910

tests/scripts/task_rust.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
#!/bin/bash
22

33
set -e
4+
set -u
45

56
export TVM_HOME="$(git rev-parse --show-toplevel)"
67

7-
export LD_LIBRARY_PATH="$TVM_HOME/lib":"$TVM_HOME/build":"$TVM_HOME/nnvm":$LD_LIBRARY_PATH
8+
export LD_LIBRARY_PATH="$TVM_HOME/lib:$TVM_HOME/build:$TVM_HOME/nnvm:${LD_LIBRARY_PATH:-}"
89
export PYTHONPATH="$TVM_HOME/python":"$TVM_HOME/nnvm/python":"$TVM_HOME/topi/python"
910
export RUST_DIR="$TVM_HOME/rust"
1011

0 commit comments

Comments
 (0)