Changeset 11069 in ntrip for trunk/BNC/tests/run_tests.py


Ignore:
Timestamp:
Oct 5, 2026, 12:35:49 PM (9 days ago)
Author:
stuerze
Message:

update test suite

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/tests/run_tests.py

    r11060 r11069  
    3939  tests/run_tests.py                 run all cases
    4040  tests/run_tests.py ssr_ rinex      run cases whose name contains a pattern
    41   tests/run_tests.py --update NAME   (re)generate the reference outputs
     41  tests/run_tests.py --update NAME   (re)generate the reference outputs; references of
     42                                     outputs no longer produced are removed
    4243  tests/run_tests.py --list
    4344"""
    … …  
    244245                pairs.append((os.path.basename(m), m, spec))
    245246
     247    written = set()
    246248    for ref, path, spec in pairs:
    247249        actual = normalise(read_text(path))
    … …  
    249251        if update:
    250252            write_expected(expfile, actual)
     253            written.add(os.path.basename(expfile))
    251254            continue
    252255        if not os.path.exists(expfile):
    … …  
    272275
    273276    if update and res.status == "PASS":
     277        # references of outputs no longer produced (e.g. a new date in the
     278        # file name after a new raw capture) are removed
     279        for e in glob.glob(os.path.join(expdir, "*.gz")):
     280            if os.path.basename(e) not in written:
     281                os.remove(e)
    274282        res.status = "UPDATED"
    275283    return res
Note: See TracChangeset for help on using the changeset viewer.