[PATCH] rtems-test-check: Make exclude work again.
Chris Johns
chrisj at rtems.org
Mon Jan 16 23:12:27 UTC 2017
This change looks wrong. Moving test loop out of the if testdata block
means variables in the test loop are not defined. I consider it a script
bug to assume it is ok to reference a variable that is not declared
because it is ambiguous if this intended behavior or a bug.
Starvos sent me this change a few days ago and it looks good. I am
hoping he will make a patch we can merge so he can have the credit ..
diff --git a/tools/build/rtems-test-check b/tools/build/rtems-test-check
index e02f8e9..108b788 100755
--- a/tools/build/rtems-test-check
+++ b/tools/build/rtems-test-check
@@ -32,7 +32,11 @@ done
case ${mode} in
exclude)
- output=${tests}
+ if test -f $testdata; then
+ output=""
+ else
+ output="${tests}"
+ fi
;;
flags)
if [ $test_count != 1 ]; then
Are you in a position to test this change?
Chris
On 17/1/17 6:24 am, Joel Sherrill wrote:
> closes #2867.
> ---
> tools/build/rtems-test-check | 90 ++++++++++++++++++++++----------------------
> 1 file changed, 45 insertions(+), 45 deletions(-)
>
> diff --git a/tools/build/rtems-test-check b/tools/build/rtems-test-check
> index e02f8e9..e8acde0 100755
> --- a/tools/build/rtems-test-check
> +++ b/tools/build/rtems-test-check
> @@ -32,7 +32,6 @@ done
>
> case ${mode} in
> exclude)
> - output=${tests}
> ;;
> flags)
> if [ $test_count != 1 ]; then
> @@ -99,52 +98,53 @@ if test -f $testdata; then
> testdata=$ntd
> done
>
> - for t in ${tests};
> - do
> - case ${mode} in
> - exclude)
> - allow="yes"
> - for dt in ${excluded_tests};
> - do
> - if test ${t} = ${dt}; then
> - allow="no"
> - fi
> - done
> - if test ${allow} = yes; then
> - output="${output} ${t}"
> - fi
> - ;;
> - flags)
> - allow="no"
> - for et in ${expected_fails};
> - do
> - if test ${t} = ${et}; then
> - allow="yes"
> - fi
> - done
> - if test ${allow} = yes; then
> - output="-DTEST_STATE_EXPECTED_FAIL=1"
> - fi
> - allow="no"
> - for it in ${indeterminates};
> - do
> - if test ${t} = ${it}; then
> - allow="yes"
> - fi
> - done
> - if test ${allow} = yes; then
> - output="${output} -DTEST_STATE_INDETERMINATE=1"
> - fi
> - ;;
> - *)
> - echo "error: invalid mode" 1>&2
> - echo "INVALID-TEST-DATA"
> - exit 1
> - ;;
> - esac
> - done
> fi
>
> +for t in ${tests};
> +do
> + case ${mode} in
> + exclude)
> + allow="yes"
> + for dt in ${excluded_tests};
> + do
> + if test ${t} = ${dt}; then
> + allow="no"
> + fi
> + done
> + if test ${allow} = yes; then
> + output="${output} ${t}"
> + fi
> + ;;
> + flags)
> + allow="no"
> + for et in ${expected_fails};
> + do
> + if test ${t} = ${et}; then
> + allow="yes"
> + fi
> + done
> + if test ${allow} = yes; then
> + output="-DTEST_STATE_EXPECTED_FAIL=1"
> + fi
> + allow="no"
> + for it in ${indeterminates};
> + do
> + if test ${t} = ${it}; then
> + allow="yes"
> + fi
> + done
> + if test ${allow} = yes; then
> + output="${output} -DTEST_STATE_INDETERMINATE=1"
> + fi
> + ;;
> + *)
> + echo "error: invalid mode" 1>&2
> + echo "INVALID-TEST-DATA"
> + exit 1
> + ;;
> + esac
> +done
> +
> echo ${output}
>
> exit 0
>
More information about the devel
mailing list