Skip to content

Commit 36f49f3

Browse files
committed
tests: add option for runnin tests in specific test dir
1 parent b4e334f commit 36f49f3

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

Runfile

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ test: # test
2626
if [[ "$(@)" =~ ^[0-9]+$$ ]]
2727
then
2828
run test-by-index "$(@)"
29+
elif [[ "$(@)" =~ ^(2space|3space|4space|8space|tabbed|compact|nodesc)$$ ]]
30+
then
31+
run test-by-directory "$(@)"
2932
elif [[ -n "$(@)" ]]
3033
then
3134
run test-by-substring "$(@)"
@@ -41,6 +44,11 @@ test-all: lint # run all tests
4144
$(BIN)/bats --jobs 16 --no-parallelize-across-files tests/test.bats
4245
done
4346

47+
test-by-directory: lint # run all tests in test directory
48+
echo -ne "$$( tput smul )$$( tput bold )tests/$(@)/Runfile$$( tput sgr0 ) -> "
49+
TEST_RUNFILE="tests/$(@)/Runfile" \
50+
$(BIN)/bats --jobs 16 --no-parallelize-across-files tests/test.bats
51+
4452
test-by-index: lint # run test case at index
4553
for runfile in tests/*/Runfile
4654
do

0 commit comments

Comments
 (0)