Skip to content

Commit

Permalink
[TESTS] Import script robustness (set -u) (apache#2896)
Browse files Browse the repository at this point in the history
Adopt the "set -u" idiom from the docker scripts as a mechanism to
improve future robustness.
  • Loading branch information
mshawcroft authored and wweic committed Mar 29, 2019
1 parent 9e4c77c commit e0a788d
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 5 deletions.
3 changes: 2 additions & 1 deletion tests/scripts/task_cpp_unittest.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/task_golang.sh
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/task_java_unittest.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/task_python_integration.sh
Original file line number Diff line number Diff line change
@@ -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

Expand Down
3 changes: 2 additions & 1 deletion tests/scripts/task_rust.sh
Original file line number Diff line number Diff line change
@@ -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"

Expand Down

0 comments on commit e0a788d

Please sign in to comment.