From b3a0b0e9650276ed9e0763a832f3f57be842c293 Mon Sep 17 00:00:00 2001 From: Andrew Bettison Date: Thu, 7 Feb 2013 17:24:28 +1030 Subject: [PATCH] Improve test framework: fix Mac OS X bugs Mac OS X sort(1) does not support -V (version number compare), and sed(1) does not support the \+ regex operator. --- testframework.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/testframework.sh b/testframework.sh index 1aff76fe..b906d577 100644 --- a/testframework.sh +++ b/testframework.sh @@ -1395,7 +1395,7 @@ _tfw_find_tests() { local lineno local path _tfw_unpack_words "$(builtin declare -F $func)" funcname lineno path - echo $lineno ${funcname#test_} "$(abspath "$path")" + echo $lineno 0 ${funcname#test_} "$(abspath "$path")" done local include for include in "${_tfw_included_tests[@]}"; do @@ -1412,11 +1412,11 @@ _tfw_find_tests() { /*) ;; *) path="$(abspath "$_tfw_script_dir/$path")";; esac - echo $lineno.$number $name "$path" + echo $lineno $number $name "$path" done done _tfw_shopt_restore oo - ) | sort -V | $SED -e 's/^[^ ]* //' + ) | sort -n -k1 -k2 | $SED -e 's/^[0-9][0-9]* [0-9][0-9]* //' } # Return a list of test names in the _tfw_test_sourcefiles and _tfw_test_names