From d39d14b1406a9d84914a235f73a6b98c33cc2dc8 Mon Sep 17 00:00:00 2001 From: Nils Winkler Date: Fri, 20 Oct 2017 14:52:08 +0200 Subject: [PATCH] Refactored test run script so that you can run a single file Call it like this: test/run test/plugins/battery.plugin.bats If called without any parameters, all of the tests are run. --- test/run | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/test/run b/test/run index dab65268..da1aa061 100755 --- a/test/run +++ b/test/run @@ -10,4 +10,10 @@ if [ -z "${BASH_IT}" ]; then export BASH_IT fi -exec $bats_executable ${CI:+--tap} ${test_directory}/{bash_it,completion,install,lib,plugins,themes} +if [ -z "$1" ]; then + test_dirs=( ${test_directory}/{bash_it,completion,install,lib,plugins,themes} ) +else + test_dirs=( "$1" ) +fi + +exec $bats_executable ${CI:+--tap} "${test_dirs[@]}"