Changeset 2472a19


Ignore:
Timestamp:
May 18, 2018, 4:00:26 PM (6 years ago)
Author:
Aaron Moss <a3moss@…>
Branches:
new-env, with_gc
Children:
824a2dc
Parents:
ff29f08 (diff), d142ec5 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge remote-tracking branch 'origin/master' into with_gc

Location:
src/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/tests/pybin/tools.py

    rff29f08 r2472a19  
    168168def jobCount( options, tests ):
    169169        # check if the user already passed in a number of jobs for multi-threading
    170         make_flags = os.environ.get('MAKEFLAGS')
    171         make_jobs_fds = re.search("--jobserver-(auth|fds)=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None
    172         if make_jobs_fds :
    173                 tokens = os.read(int(make_jobs_fds.group(2)), 1024)
    174                 options.jobs = len(tokens)
    175                 os.write(int(make_jobs_fds.group(3)), tokens)
     170        if not options.jobs:
     171                make_flags = os.environ.get('MAKEFLAGS')
     172                force = bool(make_flags)
     173                make_jobs_fds = re.search("--jobserver-(auth|fds)=\s*([0-9]+),([0-9]+)", make_flags) if make_flags else None
     174                if make_jobs_fds :
     175                        tokens = os.read(int(make_jobs_fds.group(2)), 1024)
     176                        options.jobs = len(tokens)
     177                        os.write(int(make_jobs_fds.group(3)), tokens)
     178                else :
     179                        options.jobs = multiprocessing.cpu_count()
    176180        else :
    177                 options.jobs = multiprocessing.cpu_count()
     181                force = True
    178182
    179183        # make sure we have a valid number of jobs that corresponds to user input
     
    182186                sys.exit(1)
    183187
    184         return min( options.jobs, len(tests) ), True if make_flags else False
     188        return min( options.jobs, len(tests) ), force
    185189
    186190# setup a proper processor pool with correct signal handling
  • src/tests/test.py

    rff29f08 r2472a19  
    9696        parser.add_argument('--all', help='Run all test available', action='store_true')
    9797        parser.add_argument('--regenerate-expected', help='Regenerate the .expect by running the specified tets, can be used with --all option', action='store_true')
    98         parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int, default='8')
     98        parser.add_argument('-j', '--jobs', help='Number of tests to run simultaneously', type=int)
    9999        parser.add_argument('--list-comp', help='List all valide arguments', action='store_true')
    100100        parser.add_argument('-I','--include', help='Directory of test to include, can be used multiple time, All  if omitted', action='append')
Note: See TracChangeset for help on using the changeset viewer.