[PATCH 3/3] tests: Move rtems-test-check.py

Sebastian Huber sebastian.huber at embedded-brains.de
Mon Apr 30 06:15:52 UTC 2018


Remove shell script variant.
---
 testsuites/aclocal/rtems-test-check.m4             |   2 +-
 .../rtems-test-check.py                            |   0
 tools/build/rtems-test-check                       | 203 ---------------------
 3 files changed, 1 insertion(+), 204 deletions(-)
 rename tools/build/rtems-test-check-py => testsuites/rtems-test-check.py (100%)
 delete mode 100755 tools/build/rtems-test-check

diff --git a/testsuites/aclocal/rtems-test-check.m4 b/testsuites/aclocal/rtems-test-check.m4
index ca71795cc7..a46c4abb20 100644
--- a/testsuites/aclocal/rtems-test-check.m4
+++ b/testsuites/aclocal/rtems-test-check.m4
@@ -5,7 +5,7 @@ AC_DEFUN([RTEMS_TEST_CHECK],
 [AC_REQUIRE([RTEMS_ENV_RTEMSBSP])
  AC_REQUIRE([RTEMS_SOURCE_TOP])
  AC_MSG_CHECKING([${RTEMS_CPU}/${RTEMS_BSP} $1 test])
- tcheck="${RTEMS_SOURCE_ROOT}/tools/build/rtems-test-check-py"
+ tcheck="${RTEMS_SOURCE_ROOT}/testsuites/rtems-test-check.py"
  tdata="${RTEMS_BSP}-testsuite.tcfg"
  tincludes="${RTEMS_SOURCE_ROOT}/bsps/${RTEMS_CPU}/${RTEMS_BSP_FAMILY}/config:${RTEMS_SOURCE_ROOT}/testsuites"
  if test -f $tcheck; then
diff --git a/tools/build/rtems-test-check-py b/testsuites/rtems-test-check.py
similarity index 100%
rename from tools/build/rtems-test-check-py
rename to testsuites/rtems-test-check.py
diff --git a/tools/build/rtems-test-check b/tools/build/rtems-test-check
deleted file mode 100755
index 988556d59e..0000000000
--- a/tools/build/rtems-test-check
+++ /dev/null
@@ -1,203 +0,0 @@
-#! /bin/sh
-#
-# Copyright 2014, 2016, 2017 Chris Johns <chrisj at rtems.org>
-# All rights reserved
-#
-
-#
-# usage: rtems-test-check <mode> <bsp-test-database> <includes> <bsp> <tests..>
-#
-
-if test $# -lt 4; then
-  echo "error: invalid command line" >&2
-  echo "INVALID-TEST-DATA"
-  exit 2
-fi
-
-mode="$1"
-shift
-testdata="$1"
-shift
-includepath="$1"
-shift
-bsp="$1"
-shift
-tests="$*"
-
-test_count=0
-for t in ${tests};
-do
- test_count=$(expr ${test_count} + 1)
-done
-
-case ${mode} in
- exclude)
-   if test -f $testdata; then
-     output=""
-   else
-     output="${tests}"
-   fi
-   ;;
- flags)
-   if [ $test_count != 1 ]; then
-     echo "error: test count not 1 for ${mode}" 1>&2
-     exit 1
-   fi
-   output=""
-   ;;
- *)
-   echo "error: invalid mode" 1>&2
-   echo "INVALID-TEST-DATA"
-   exit 1
-   ;;
-esac
-
-#
-# Read the common settings first.
-#
-if [ -f $includepath/testdata/rtems.tcfg ]; then
- testdata="$includepath/testdata/rtems.tcfg $testdata"
-fi
-
-#
-# If there is no testdata all tests are valid and must pass.
-#
-
-if [ ! -z "$testdata" ]; then
-  excluded_tests=""
-  expected_fails=""
-  user_inputs=""
-  indeterminates=""
-  benchmarks=""
-  while [ ! -z "$testdata" ];
-  do
-    for td in $testdata;
-    do
-      if [ ! -f $td ]; then
-        continue
-      fi
-      ntd=""
-      exec 3<& 0
-      exec 0<$td
-      while read line
-      do
-        line=$(echo $line | sed -e 's/#.*$//' -e '/^$/d')
-        if [ ! -z "$line" ]; then
-          state=$(echo $line | sed -e "s/:.*//g")
-          case $state in
-            include)
-              inf=$(echo $line | sed -e 's/include://g;s/[[:blank:]]//g')
-              if test -f $includepath/$inf; then
-                ntd="$includepath/$inf $ntd"
-              fi
-              ;;
-            exclude)
-              line=$(echo $line | sed -e 's/exclude://g;s/[[:blank:]]//g')
-              excluded_tests="${excluded_tests} $line"
-              ;;
-            expected-fail)
-              line=$(echo $line | sed -e 's/expected-fail://g;s/[[:blank:]]//g')
-              expected_fails="${expected_fails} $line"
-              ;;
-            user-input)
-              line=$(echo $line | sed -e 's/user-input://g;s/[[:blank:]]//g')
-              user_inputs="${user_inputs} $line"
-              ;;
-            indeterminate)
-              line=$(echo $line | sed -e 's/indeterminate://g;s/[[:blank:]]//g')
-              indeterminates="${indeterminates} $line"
-              ;;
-            benchmark)
-              line=$(echo $line | sed -e 's/benchmark://g;s/[[:blank:]]//g')
-              benchmarks="${benchmarks} $line"
-              ;;
-            *)
-              echo "error: invalid test state: $state in $td" 1>&2
-              echo "INVALID-TEST-DATA"
-              exit 1
-              ;;
-          esac
-        fi
-      done
-    done
-    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="yes"
-        for et in ${excluded_tests};
-        do
-          if test ${t} = ${et}; then
-            allow="no"
-          fi
-        done
-	if test ${allow} = yes; then
-          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 ut in ${user_inputs};
-          do
-            if test ${t} = ${ut}; then
-              allow="yes"
-            fi
-          done
-          if test ${allow} = yes; then
-            output="-DTEST_STATE_USER_INPUT=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
-          allow="no"
-          for bt in ${benchmarks};
-          do
-            if test ${t} = ${bt}; then
-              allow="yes"
-            fi
-          done
-          if test ${allow} = yes; then
-            output="${output} -DTEST_STATE_BENCHMARK=1"
-          fi
-	fi
-        ;;
-      *)
-        echo "error: invalid mode" 1>&2
-        echo "INVALID-TEST-DATA"
-        exit 1
-        ;;
-    esac
-  done
-fi
-
-echo ${output}
-
-exit 0
-- 
2.12.3




More information about the devel mailing list