[rtems commit] testsuite: Fix excluding tests that a substring of another test.

Chris Johns chrisj at rtems.org
Thu May 25 05:14:24 UTC 2017


Module:    rtems
Branch:    master
Commit:    30eeb0d15ac874d2ef0f92afeb757e65ff398e77
Changeset: http://git.rtems.org/rtems/commit/?id=30eeb0d15ac874d2ef0f92afeb757e65ff398e77

Author:    Chris Johns <chrisj at rtems.org>
Date:      Thu May 25 15:11:45 2017 +1000

testsuite: Fix excluding tests that a substring of another test.

Fix excluding `math` when there is a test `mathl`. The shell test
used fails in this case. This patch's approach is much simpler.

---

 testsuites/automake/subdirs.am | 21 ++++++++++-----------
 1 file changed, 10 insertions(+), 11 deletions(-)

diff --git a/testsuites/automake/subdirs.am b/testsuites/automake/subdirs.am
index 56e1ec5..f4152e5 100644
--- a/testsuites/automake/subdirs.am
+++ b/testsuites/automake/subdirs.am
@@ -8,8 +8,7 @@ define TESTDIR
 .PHONY: $1
 $1:
 	@+set fnord $(MAKEFLAGS); \
-	subdir=$(1); \
-	if test "$$$$subdir" != "."; then \
+	if test "$(1)" != "."; then \
 	  target=`echo $(MAKECMDGOALS) | sed s/-recursive//`; \
 	  if test "$$$$target" = "all-local-am"; then \
 	    target="all-am"; \
@@ -21,25 +20,25 @@ $1:
 	  tdata="$(RTEMS_BSP)-testsuite.tcfg"; \
 	  tincludes="$(top_srcdir)/../../c/src/lib/libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom:$(top_srcdir)/.."; \
 	  if test -f $$$$tcheck; then \
-	    list=`$$$$tcheck exclude $(RTEMS_BSP) $$$$tdata $$$$tincludes $(_SUBDIRS)`; \
+	    check_result=`$$$$tcheck exclude $(RTEMS_BSP) $$$$tdata $$$$tincludes $(1)`; \
 	  else \
-	    list=; \
+	    check_result="$(1)"; \
 	  fi; \
-	  if test "$$$${list#*$$$$subdir}" != "$$$$list"; then \
+	  if test "$(1)" = "$$$$check_result"; then \
 	    if test -f $$$$tcheck; then \
-	      test_FLAGS=`$$$$tcheck flags $(RTEMS_BSP) $$$$tdata $$$$tincludes $$$$subdir`; \
+	      test_FLAGS=`$$$$tcheck flags $(RTEMS_BSP) $$$$tdata $$$$tincludes $(1)`; \
 	    fi; \
 	    local_target="$$$$target"; \
 	    if test -z "$$$$test_FLAGS"; then \
-	      echo "BSP Testsuite: $$$$subdir: PASS"; \
+	      echo "BSP Testsuite: $(1): PASS"; \
 	    else \
-	      echo "BSP Testsuite: $$$$subdir: $$$$test_FLAGS"; \
+	      echo "BSP Testsuite: $(1): $$$$test_FLAGS"; \
 	    fi; \
-	    echo "Making $$$$target in $$$$subdir"; \
-	    cd $$$$subdir; \
+	    echo "Making $$$$target in $(1)"; \
+	    cd $(1); \
 	    $(MAKE) $(AM_MAKEFLAGS) TEST_FLAGS="$$$$test_FLAGS" $$$$local_target; \
 	  else \
-	    echo "BSP Testsuite: $$$$subdir: EXCLUDED"; \
+	    echo "BSP Testsuite: $(1): EXCLUDED"; \
 	  fi; \
 	fi;
 endef




More information about the vc mailing list