From 5f20299e628f16ad4221fe925b2bcf9fad1ba9a8 Mon Sep 17 00:00:00 2001 From: Sam Perry Date: Tue, 22 Mar 2016 16:44:55 +0000 Subject: [PATCH] added link to run tests and made the shell script work when called from any directory. --- run_tests | 1 + src/tests/run_tests.sh | 8 ++++++++ 2 files changed, 9 insertions(+) create mode 120000 run_tests diff --git a/run_tests b/run_tests new file mode 120000 index 0000000..494fdff --- /dev/null +++ b/run_tests @@ -0,0 +1 @@ +./src/tests/run_tests.sh \ No newline at end of file diff --git a/src/tests/run_tests.sh b/src/tests/run_tests.sh index 50d2dd0..90664e0 100755 --- a/src/tests/run_tests.sh +++ b/src/tests/run_tests.sh @@ -1 +1,9 @@ +SOURCE="${BASH_SOURCE[0]}" +while [ -h "$SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink + DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" + SOURCE="$(readlink "$SOURCE")" + [[ $SOURCE != /* ]] && SOURCE="$DIR/$SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located +done +DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )" +cd $DIR python -m unittest -v audiofile_tests