Shorten some comments
# ./run-tests -k
# ./run-tests spec/coder_spec.lua
+echo "--- Test Suite ---"
+
# We encourage using -no-keep-going by default. Sometimes the test suite is failing because of
# something silly such as forgetting to run make and in those cases there is a desire to interrupt
# the test suite with Ctrl-C. With --keep-going (the default busted behavior) you need to press
@@ -19,13 +21,6 @@ FLAGS=(--verbose --no-keep-going)
# Don't worry, the continuous integration server still tests with optimizations.
export CFLAGS=-O0
-# We can also speed things up by running multiple busted processes in parallel. But unfortunately,
-# busted is single-threaded so we have to parallelize it ourselves. We use GNU parallel, albeit only
-# in the default case where no command-line arguments are given. I didn't want to wrap busted in the
-# case where we are testing a single spec file, because in that case GNU parallel would only show
-# the output after the last test has finished. I'd rather see the little green circle for each test
-# case as soon as it completes.
-echo "--- Test Suite ---"
if [ "$#" -eq 0 ]; then
if command -v parallel >/dev/null; then
parallel busted -o utfTerminal "${FLAGS[@]}" ::: spec/*_spec.lua
@@ -33,8 +28,10 @@ if [ "$#" -eq 0 ]; then
echo "GNU Parallel is not installed. Running the test suite in single threaded mode..."
busted "${FLAGS[@]}"
fi
- # By default, also run the linter tests, because the CI cares about them.
+ # By default, also run the linter because the CI cares about that.
./run-lint --quiet
else
+ # If we are running tests for a single spec file, then we do not use GNU Parallel. This way the
+ # progress updates after each test, instead of all at once at end.
busted "${FLAGS[@]}" "$@"
fi
