1. Jakub Wilk
  2. shellcat

Commits

Jakub Wilk  committed e45c01a

tests: make the test runner more flexible.

  • Participants
  • Parent commits daa8871
  • Branches default

Comments (0)

Files changed (3)

File tests/Makefile

View file
 .PHONY: all
 all: ../shellcat
-	./run-tests
+	./run-tests $(<)
 
 ../shellcat:
 	$(MAKE) -C ..

File tests/common.sh

View file
 
 run_shellcat()
 {
-    "$shellcat" "$f_input" "$@" > "$f_output"
+    $shellcat "$f_input" "$@" > "$f_output"
     exec diff -u "$f_expected" "$f_output" 
 }
 

File tests/run-tests

View file
 #!/bin/sh
 set -e -u
 
-export shellcat=${1:-../shellcat}
+if [ -z "${*##-*}" ]
+then
+    printf 'Usage: %s <shellcat-executable> [extra-args...]\n' "$0"
+    exit 1
+fi
+
+export shellcat="$*"
 
 hr()
 {