Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/tests/test.py

    r4782b39 r850fda6  
    104104#               running test functions
    105105################################################################################
    106 def run_single_test(test, generate, dry_run, debug):
     106def run_single_test(test, generate, dry_run):
    107107
    108108        # find the output file based on the test name and options flag
     
    113113        sh("rm -f %s > /dev/null 2>&1" % test.name, dry_run)
    114114
    115         options = "-debug" if debug else "-nodebug";
    116 
    117115        # build, skipping to next test on error
    118         make_ret, _ = sh("""%s EXTRA_FLAGS="-quiet %s" %s 2> %s 1> /dev/null""" % (make_cmd, options, test.name, out_file), dry_run)
     116        make_ret, _ = sh("%s %s 2> %s 1> /dev/null" % (make_cmd, test.name, out_file), dry_run)
    119117
    120118        # if the make command succeds continue otherwise skip to diff
     
    167165        return retcode, error
    168166
    169 def run_test_instance(t, generate, dry_run, debug) :
     167def run_test_instance(t, generate, dry_run) :
    170168        # print formated name
    171169        name_txt = "%20s  " % t.name
    172170
    173171        #run the test instance and collect the result
    174         test_failed, error = run_single_test(t, generate, dry_run, debug)
     172        test_failed, error = run_single_test(t, generate, dry_run)
    175173
    176174        # update output based on current action
     
    196194
    197195# run the given list of tests with the given parameters
    198 def run_tests(tests, generate, dry_run, jobs, debug) :
     196def run_tests(tests, generate, dry_run, jobs) :
    199197        # clean the sandbox from previous commands
    200198        sh("%s clean > /dev/null 2>&1" % make_cmd, dry_run)
     
    209207        pool = Pool(jobs)
    210208        try :
    211                 results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run, debug=debug), tests ).get(99999999)
     209                results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run), tests ).get(99999999)
    212210        except KeyboardInterrupt:
    213211                pool.terminate()
     
    224222        return 0
    225223
    226 def yes_no(string):
    227         if string == "yes" :
    228                 return True
    229         if string == "no" :
    230                 return False
    231         raise argparse.ArgumentTypeError(msg)
    232         return False
    233 
    234 
    235224################################################################################
    236225#               main loop
     
    238227# create a parser with the arguments for the tests script
    239228parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    240 parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no')
    241229parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
    242230parser.add_argument('--list', help='List all test available', action='store_true')
     
    308296        sys.exit(1)
    309297
    310 print('Running (%s) on %i cores' % ("debug" if options.debug else "no debug", options.jobs))
     298print('Running on %i cores' % options.jobs)
    311299make_cmd = "make" if make_flags else ("make -j%i" % options.jobs)
    312300
     
    317305else :
    318306        # otherwise run all tests and make sure to return the correct error code
    319         sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run, options.jobs, options.debug) )
     307        sys.exit( run_tests(tests, options.regenerate_expected, options.dry_run, options.jobs) )
Note: See TracChangeset for help on using the changeset viewer.