Changeset be65cca


Ignore:
Timestamp:
Mar 1, 2017, 3:13:04 PM (7 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, aaron-thesis, arm-eh, ast-experimental, cleanup-dtors, deferred_resn, demangler, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, new-env, no_list, persistent-indexer, pthread-emulation, qualifiedEnum, resolv-new, with_gc
Children:
a62cbb3
Parents:
60401b76
Message:

Concurrent tests no longer run when threading is disable

Location:
src/tests
Files:
3 edited
4 moved

Legend:

Unmodified
Added
Removed
  • src/tests/Makefile.am

    r60401b76 rbe65cca  
    1717debug=yes
    1818
     19quick_test=vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once
     20
     21if BUILD_CONCURRENCY
     22concurrent=yes
     23quick_test+= coroutine thread monitor
     24else
     25concurrent=no
     26endif
     27
     28
    1929# applies to both programs
    2030EXTRA_FLAGS =
     
    3040
    3141all-local :
    32         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
     42        @+python test.py ${quick_test}
    3343
    3444all-tests :
    35         @+python test.py --all --debug=${debug}         # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     45        @+python test.py --all --debug=${debug} --concurrent=${concurrent}              # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    3646
    3747clean-local :
     
    3949
    4050list :
    41         @+python test.py --list
     51        @+python test.py --list --concurrent=${concurrent}
    4252
    4353constant0-1DP : constant0-1.c
  • src/tests/Makefile.in

    r60401b76 rbe65cca  
    3737build_triplet = @build@
    3838host_triplet = @host@
     39@BUILD_CONCURRENCY_TRUE@am__append_1 = coroutine thread monitor
    3940EXTRA_PROGRAMS = fstream_test$(EXEEXT) vector_test$(EXEEXT) \
    4041        avl_test$(EXEEXT) constant0-1DP$(EXEEXT) \
     
    222223top_srcdir = @top_srcdir@
    223224debug = yes
     225quick_test = vector_test avl_test operators numericConstants \
     226        expression enum array typeof cast dtor-early-exit init_once \
     227        $(am__append_1)
     228@BUILD_CONCURRENCY_FALSE@concurrent = no
     229@BUILD_CONCURRENCY_TRUE@concurrent = yes
    224230
    225231# applies to both programs
     
    651657
    652658all-local :
    653         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
     659        @+python test.py ${quick_test}
    654660
    655661all-tests :
    656         @+python test.py --all --debug=${debug}         # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
     662        @+python test.py --all --debug=${debug} --concurrent=${concurrent}              # '@' => do not echo command (SILENT), '+' => allows recursive make from within python program
    657663
    658664clean-local :
     
    660666
    661667list :
    662         @+python test.py --list
     668        @+python test.py --list --concurrent=${concurrent}
    663669
    664670constant0-1DP : constant0-1.c
  • src/tests/test.py

    r60401b76 rbe65cca  
    3232        return re.search("ELF\s([0-9]+)-bit", out).group(1)
    3333
    34 # reads the directory ./.expect and indentifies the tests
    35 def listTests():
    36         machineType = getMachineType()
     34def listTestsFolder(folder) :
     35        path = ('./.expect/%s' % folder) if folder else './expect'
    3736
    3837        # tests directly in the .expect folder will always be processed
    39         generic_list = map(lambda fname: Test(fname, fname),
    40                 [splitext(f)[0] for f in listdir('./.expect')
     38        return map(lambda fname: Test(fname, '%s/%s' % (path, fname)),
     39                [splitext(f)[0] for f in listdir( path )
    4140                if not f.startswith('.') and f.endswith('.txt')
    4241                ])
    4342
     43# reads the directory ./.expect and indentifies the tests
     44def listTests( concurrent ):
     45        machineType = getMachineType()
     46
     47        # tests directly in the .expect folder will always be processed
     48        generic_list = listTestsFolder( "." )
     49
    4450        # tests in the machineType folder will be ran only for the corresponding compiler
    45         typed_list = map(lambda fname: Test( fname, "%s/%s" % (machineType, fname) ),
    46                 [splitext(f)[0] for f in listdir("./.expect/%s" % machineType)
    47                 if not f.startswith('.') and f.endswith('.txt')
    48                 ])
     51        typed_list = listTestsFolder( machineType )
     52
     53        # tests in the concurrent folder will be ran only if concurrency is enabled
     54        concurrent_list = listTestsFolder( "concurrent" ) if concurrent else []
    4955
    5056        # append both lists to get
    51         return generic_list + typed_list
     57        return generic_list + typed_list + concurrent_list;
    5258
    5359# helper functions to run terminal commands
     
    194200                sys.stderr.flush()
    195201                return test_failed
    196        
     202
    197203        except KeyboardInterrupt:
    198204                test_failed = True
     
    243249parser = argparse.ArgumentParser(description='Script which runs cforall tests')
    244250parser.add_argument('--debug', help='Run all tests in debug or release', type=yes_no, default='no')
     251parser.add_argument('--concurrent', help='Run concurrent tests', type=yes_no, default='no')
    245252parser.add_argument('--dry-run', help='Don\'t run the tests, only output the commands', action='store_true')
    246253parser.add_argument('--list', help='List all test available', action='store_true')
     
    260267        sys.exit(1)
    261268
     269print( options.concurrent )
     270
    262271# fetch the liest of all valid tests
    263 allTests = listTests()
     272allTests = listTests( options.concurrent )
    264273
    265274# if user wants all tests than no other treatement of the test list is required
Note: See TracChangeset for help on using the changeset viewer.