diff options
-rwxr-xr-x | abe.sh | 16 | ||||
-rwxr-xr-x | test.sh | 30 |
2 files changed, 42 insertions, 4 deletions
@@ -1046,6 +1046,13 @@ while test $# -gt 0; do exit 0 ;; *) + # Look for unsupported -<foo> or --<foo> directives. + if test `echo $1 | grep -Ec "^-+"` -gt 0; then + error "${1}: Directive not supported. See ${abe} --help for supported options." + build_failure + fi + + # Test for <foo>= specifiers if test `echo $1 | grep -c =` -gt 0; then name="`echo $1 | cut -d '=' -f 1`" value="`echo $1 | cut -d '=' -f 2`" @@ -1100,14 +1107,21 @@ while test $# -gt 0; do newlib_version="${value}" ;; *) + error "FIXME: Execution should never reach this point." + build_failure ;; esac ;; *) + # This will catch unsupported component specifiers like <foo>= + error "${name}: Component specified not supported. See ${abe} --help for supported components." + build_failure ;; esac else - error "$1: Command not recognized." + # This will catch dangling words like <foo> that don't contain + # --<foo> and don't contain <foo>= + error "$1: Command not recognized. See ${abe} --help for supported options." build_failure fi ;; @@ -251,19 +251,43 @@ match='' test_pass "${cb_commands}" "${match}" cb_commands="--dr" -match="Command not recognized" +match="Directive not supported" test_failure "${cb_commands}" "${match}" cb_commands="-dr" -match="Command not recognized" +match="Directive not supported" test_failure "${cb_commands}" "${match}" cb_commands="--drnasdfa" -match="Command not recognized" +match="Directive not supported" test_failure "${cb_commands}" "${match}" # Test for expected failure for removed deprecated feature --dostep. cb_commands="--dostep" +match="Directive not supported" +test_failure "${cb_commands}" "${match}" + +# Test for expected failure for --libc=<foo> +# https://bugs.linaro.org/show_bug.cgi?id=1372 +cb_commands="--libc" +match="Directive not supported" +test_failure "${cb_commands}" "${match}" + +# Test for expected failure for --libc=<foo> +# https://bugs.linaro.org/show_bug.cgi?id=1372 +cb_commands="--libc=" +match="Directive not supported" +test_failure "${cb_commands}" "${match}" + +# Test for expected failure for unknown toolchain component +# https://bugs.linaro.org/show_bug.cgi?id=1372 +cb_commands="libc=" +match="Component specified not supported" +test_failure "${cb_commands}" "${match}" + +# Test for non-directive dangling command +# https://bugs.linaro.org/show_bug.cgi?id=1372 +cb_commands="libc" match="Command not recognized" test_failure "${cb_commands}" "${match}" |