Changeset 18f63c0 in rtems


Ignore:
Timestamp:
Apr 15, 2017, 11:51:57 PM (2 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
54bdf0c
Parents:
b53ad46
git-author:
Chris Johns <chrisj@…> (04/15/17 23:51:57)
git-committer:
Chris Johns <chrisj@…> (04/18/17 02:27:57)
Message:

testsuite: Fix rtems-test-check not excluding tests.

The include file handling was broken.

Add a test configuration data README.

Closes #2981.

Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • testsuites/automake/subdirs.am

    rb53ad46 r18f63c0  
    1616        fi; \
    1717        tcheck="$(top_srcdir)/../../tools/build/rtems-test-check-py"; \
    18         tdata="$(top_srcdir)/../../c/src/lib/libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom/$(RTEMS_BSP)-testsuite.tcfg"; \
     18        tdata="$(RTEMS_BSP)-testsuite.tcfg"; \
     19        tincludes="$(top_srcdir)/../../c/src/lib/libbsp/$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom:$(top_srcdir)/.."; \
    1920        if test -f "$$tdata"; then \
    2021          vtdata="$(RTEMS_CPU)/$(RTEMS_BSP_FAMILY)/make/custom/$(RTEMS_BSP)-testsuite.tcfg"; \
     
    2425        echo "BSP Testsuite Data: $$vtdata"; \
    2526        if test -f $$tcheck; then \
    26           list=`$$tcheck exclude $$tdata $(top_srcdir)/.. $(RTEMS_BSP) $(_SUBDIRS)`; \
     27          list=`$$tcheck exclude $(RTEMS_BSP) $$tdata $$tincludes $(_SUBDIRS)`; \
    2728        else \
    2829          list=$(_SUBDIRS); \
     
    3233          if test "$$subdir" != "."; then \
    3334            if test -f $$tcheck; then \
    34               test_FLAGS=`$$tcheck flags $$tdata $(top_srcdir)/.. $(RTEMS_BSP) $$subdir`; \
     35              test_FLAGS=`$$tcheck flags $(RTEMS_BSP) $$tdata $$tincludes $$subdir`; \
    3536            fi; \
    3637            local_target="$$target"; \
  • tools/build/rtems-test-check-py

    rb53ad46 r18f63c0  
    1717
    1818#
     19# Search the include paths for a file.
     20#
     21def find_testdata(paths, name):
     22    for p in paths:
     23        fn = os.path.join(p, name)
     24        if os.path.exists(fn):
     25            return fn
     26    return None
     27
     28#
    1929# Arguments. Keep it simple.
    2030#
     
    2434    sys.exit(2)
    2535
    26 mode = sys.argv[1]
    27 testconfig = [sys.argv[2]]
    28 includepath = sys.argv[3]
    29 bsp = sys.argv[4]
    30 tests = sys.argv[5:]
     36verbose = False
     37args = 0
     38
     39if sys.argv[1] == '-v':
     40    verbose = True
     41    args = 1
     42
     43mode = sys.argv[args + 1]
     44bsp = sys.argv[args + 2]
     45includepaths = sys.argv[args + 4].split(':')
     46testconfig = [find_testdata(includepaths, sys.argv[args + 3])]
     47tests = sys.argv[args + 5:]
    3148
    3249#
     
    4865# Common RTEMS testsuite configuration. Load first.
    4966#
    50 rtems_testdata = os.path.join(includepath, 'testdata', 'rtems.tcfg')
    51 if os.path.exists(rtems_testdata):
     67rtems_testdata = find_testdata(includepaths, os.path.join('testdata', 'rtems.tcfg'))
     68if rtems_testdata is not None:
    5269    testconfig.insert(0, rtems_testdata)
    5370
     
    6481testdata = {}
    6582
     83if verbose:
     84    eprint('mode: %s' % (mode))
     85    eprint('testconfig: %s' % (', '.join(testconfig)))
     86    eprint('includepaths: %s' % (includepaths))
     87    eprint('bsp: %s' % (bsp))
     88    eprint('tests: %s' % (', '.join(tests)))
     89
    6690def clean(line):
    6791    line = line[0:-1]
     
    7498# Load the test data.
    7599#
    76 for tc in range(0, len(testconfig)):
    77     if not os.path.exists(testconfig[tc]):
     100while len(testconfig):
     101    tc = testconfig[0]
     102    testconfig.remove(tc)
     103    if verbose:
     104        eprint('reading: %s' % (tc))
     105    if not os.path.exists(tc):
     106        if verbose:
     107            eprint('%s: not found' % (tc))
    78108        continue
    79     with open(testconfig[tc]) as f:
     109    with open(tc) as f:
    80110        tdata = [clean(l) for l in f.readlines()]
    81111    lc = 0
     
    85115        if len(line) == 0:
    86116            continue
     117        if verbose:
     118            eprint('%4d: %s' % (lc, line))
    87119        if len(ls) != 2:
    88120            eprint('error: syntax error: %s:%d' % (tc, lc))
     
    92124        test = ls[1]
    93125        if state == 'include':
    94             testconfig.insert(tc, test)
     126            td = find_testdata(includepaths, test)
     127            if td is None:
     128                eprint('error: include not found: %s:%d' % (tc, lc))
     129                print('INVALID-TEST-DATA')
     130            testconfig.insert(0, td)
     131            if verbose:
     132                eprint('include: %s' % (', '.join(testconfig)))
    95133        elif state in states:
    96134            if state not in testdata:
Note: See TracChangeset for help on using the changeset viewer.