Changeset b4d65c7 for src/tests


Ignore:
Timestamp:
Feb 6, 2017, 4:19:53 PM (7 years ago)
Author:
Peter A. Buhr <pabuhr@…>
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:
424931d, fe26fbf
Parents:
c0aa336 (diff), 6a5f0e7 (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 branch 'master' of plg2:software/cfa/cfa-cc

Location:
src/tests
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • src/tests/Makefile.am

    rc0aa336 rb4d65c7  
    3030
    3131all-local :
    32         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine
     32        @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
    3333
    3434all-tests :
  • src/tests/Makefile.in

    rc0aa336 rb4d65c7  
    651651
    652652all-local :
    653         @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine
     653        @+python test.py vector_test avl_test operators numericConstants expression enum array typeof cast dtor-early-exit init_once coroutine thread
    654654
    655655all-tests :
  • src/tests/dtor-early-exit.c

    rc0aa336 rb4d65c7  
    2828// don't want these called
    2929void ?{}(A * a) { assert( false ); }
    30 void ?{}(A * a, char * name) { a->name = name; sout | "construct " | name | endl; a->x = malloc(); }
     30void ?{}(A * a, char * name) { a->name = name; sout | "construct " | name | endl; a->x = (int*)malloc(); }
    3131void ?{}(A * a, char * name, int * ptr) { assert( false ); }
    3232
    3333A ?=?(A * a, A a) {  sout | "assign " | a->name | " " | a.name; return a; }
    34 void ?{}(A * a, A a) { sout | "copy construct " | a.name | endl; a->x = malloc(); }
     34void ?{}(A * a, A a) { sout | "copy construct " | a.name | endl; a->x = (int*)malloc(); }
    3535void ^?{}(A * a) { sout | "destruct " | a->name | endl; free(a->x); }
    3636
  • src/tests/test.py

    rc0aa336 rb4d65c7  
    168168
    169169def run_test_instance(t, generate, dry_run, debug) :
    170         # print formated name
    171         name_txt = "%20s  " % t.name
    172 
    173         #run the test instance and collect the result
    174         test_failed, error = run_single_test(t, generate, dry_run, debug)
    175 
    176         # update output based on current action
    177         if generate :
    178                 failed_txt = "ERROR"
    179                 success_txt = "Done"
    180         else :
    181                 failed_txt = "FAILED"
    182                 success_txt = "PASSED"
    183 
    184         #print result with error if needed
    185         text = name_txt + (failed_txt if test_failed else success_txt)
    186         out = sys.stdout
    187         if error :
    188                 text = text + "\n" + error
    189                 out = sys.stderr
    190 
    191         print(text, file = out);
    192         sys.stdout.flush()
    193         sys.stderr.flush()
    194 
    195         return test_failed
     170        try :
     171                # print formated name
     172                name_txt = "%20s  " % t.name
     173
     174                #run the test instance and collect the result
     175                test_failed, error = run_single_test(t, generate, dry_run, debug)
     176
     177                # update output based on current action
     178                if generate :
     179                        failed_txt = "ERROR"
     180                        success_txt = "Done"
     181                else :
     182                        failed_txt = "FAILED"
     183                        success_txt = "PASSED"
     184
     185                #print result with error if needed
     186                text = name_txt + (failed_txt if test_failed else success_txt)
     187                out = sys.stdout
     188                if error :
     189                        text = text + "\n" + error
     190                        out = sys.stderr
     191
     192                print(text, file = out);
     193                sys.stdout.flush()
     194                sys.stderr.flush()
     195                return test_failed
     196       
     197        except KeyboardInterrupt:
     198                test_failed = True
     199
    196200
    197201# run the given list of tests with the given parameters
     
    209213        pool = Pool(jobs)
    210214        try :
    211                 results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run, debug=debug), tests ).get(99999999)
     215                results = pool.map_async(partial(run_test_instance, generate=generate, dry_run=dry_run, debug=debug), tests ).get(9999)
    212216        except KeyboardInterrupt:
    213217                pool.terminate()
  • src/tests/tupleVariadic.c

    rc0aa336 rb4d65c7  
    2929}
    3030
    31 forall(otype T, ttype Params | { void ?{}(T *, Params); })
     31forall( dtype T, ttype Params | sized(T) | { void ?{}(T *, Params); } )
    3232T * new(Params p);
    3333
Note: See TracChangeset for help on using the changeset viewer.