Changeset a5ea261 for tests


Ignore:
Timestamp:
Apr 19, 2023, 10:39:24 AM (19 months ago)
Author:
Andrew Beach <ajbeach@…>
Branches:
ADT, ast-experimental, master
Children:
028e512
Parents:
81bd7e3
Message:

The test.py (through Makefile) handles --invariant passing it to the build. It passes it through CFAFLAGS which are the caller's additional configuration. This is simpler than creating a config variable and then passing 'invariant=yes' to make (like debug or installed).

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/settings.py

    r81bd7e3 ra5ea261  
    126126        global archive
    127127        global install
     128        global invariant
    128129
    129130        global continue_
     
    140141        all_install  = [Install(o)      for o in list(dict.fromkeys(options.install))]
    141142        archive      = os.path.abspath(os.path.join(original_path, options.archive_errors)) if options.archive_errors else None
     143        invariant    = options.invariant
    142144        continue_    = options.continue_
    143145        dry_run      = options.dry_run # must be called before tools.config_hash()
  • tests/test.py

    r81bd7e3 ra5ea261  
    114114        parser.add_argument('--install', help='Run all tests based on installed binaries or tree binaries', type=comma_separated(yes_no), default='no')
    115115        parser.add_argument('--continue', help='When multiple specifications are passed (debug/install/arch), sets whether or not to continue if the last specification failed', type=yes_no, default='yes', dest='continue_')
     116        parser.add_argument('--invariant', help='Tell the compiler to check invariants while running.', action='store_true')
    116117        parser.add_argument('--timeout', help='Maximum duration in seconds after a single test is considered to have timed out', type=int, default=180)
    117118        parser.add_argument('--global-timeout', help='Maximum cumulative duration in seconds after the ALL tests are considered to have timed out', type=int, default=7200)
     
    172173        test.prepare()
    173174
     175        # extra flags for cfa to pass through make.
     176        cfa_flags = 'CFAFLAGS=--invariant' if settings.invariant else None
     177
    174178        # ----------
    175179        # MAKE
     
    177181        # build, skipping to next test on error
    178182        with Timed() as comp_dur:
    179                 make_ret, _, _ = make( test.target(), output_file=subprocess.DEVNULL, error=out_file, error_file = err_file )
     183                make_ret, _, _ = make(test.target(), flags=cfa_flags, output_file=subprocess.DEVNULL, error=out_file, error_file=err_file)
    180184
    181185        # ----------
Note: See TracChangeset for help on using the changeset viewer.