From 3cd32a4a0ed5e67bc46a5871711a3bf9289ad8bc Mon Sep 17 00:00:00 2001 From: Eric Levy Date: Mon, 24 Jan 2022 17:04:49 -0500 Subject: [PATCH] Add `meta` tests, to validate handling of functions for subshells --- meta-tests.txt | 0 run-meta-tests | 23 +++++++++++++++++++++++ run-tests | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 meta-tests.txt create mode 100644 run-meta-tests diff --git a/meta-tests.txt b/meta-tests.txt new file mode 100644 index 0000000..e69de29 diff --git a/run-meta-tests b/run-meta-tests new file mode 100644 index 0000000..3af69f0 --- /dev/null +++ b/run-meta-tests @@ -0,0 +1,23 @@ +#!/usr/bin/env bash + +cd "$(dirname "$0")" || exit 1 + +for TEST in $(cat meta-tests.txt); do + + echo -n "meta:$TEST ... " + + ( + meta-tests/${TEST}.sh > /dev/null 2> /dev/null + ) + + statusCode=$? + + if [[ $statusCode -ne 0 ]]; then + echo "FAIL (status code $statusCode)" + FAIL=$(( FAIL + 1 )) + else + echo "ok" + PASS=$(( PASS + 1 )) + fi + +done diff --git a/run-tests b/run-tests index e5016f3..33889b7 100755 --- a/run-tests +++ b/run-tests @@ -9,6 +9,8 @@ FAIL=0 source ./run-basic-tests +source ./run-meta-tests + echo "" echo "Pass: $PASS" echo "Fail: $FAIL"