Changeset 9cd44ba


Ignore:
Timestamp:
Mar 3, 2022, 2:43:18 PM (3 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, ast-experimental, enum, master, pthread-emulation, qualifiedEnum
Children:
d529ad0
Parents:
d9d8b9f
Message:

change tests to evaluate -j option once

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/pybin/tools.py

    rd9d8b9f r9cd44ba  
    290290################################################################################
    291291# count number of jobs to create
    292 def job_count( options, tests ):
     292def job_count( options ):
    293293        # check if the user already passed in a number of jobs for multi-threading
    294294        if not options.jobs:
     
    317317                sys.exit(1)
    318318
    319         return min( options.jobs, len(tests) ), force
     319        return options.jobs, force
    320320
    321321# enable core dumps for all the test children
  • tests/test.py

    rd9d8b9f r9cd44ba  
    418418                                print('WARNING: test "{}" has empty .expect file'.format(t.target()), file=sys.stderr)
    419419
     420        options.jobs, forceJobs = job_count( options )
     421        settings.update_make_cmd(forceJobs, options.jobs)
     422
    420423        # for each build configurations, run the test
    421424        with Timed() as total_dur:
     
    430433                        local_tests = settings.ast.filter( tests )
    431434                        local_tests = settings.arch.filter( local_tests )
    432                         options.jobs, forceJobs = job_count( options, local_tests )
    433                         settings.update_make_cmd(forceJobs, options.jobs)
    434435
    435436                        # check the build configuration works
    436437                        settings.validate()
     438                        jobs = min(options.jobs, len(local_tests))
    437439
    438440                        # print configuration
     
    440442                                'Regenerating' if settings.generating else 'Running',
    441443                                len(local_tests),
    442                                 options.jobs,
     444                                jobs,
    443445                                settings.ast.string,
    444446                                settings.arch.string,
     
    450452
    451453                        # otherwise run all tests and make sure to return the correct error code
    452                         failed = run_tests(local_tests, options.jobs)
     454                        failed = run_tests(local_tests, jobs)
    453455                        if failed:
    454456                                if not settings.continue_:
Note: See TracChangeset for help on using the changeset viewer.