Changeset 1582

Show
Ignore:
Timestamp:
06/20/08 12:22:40 (4 months ago)
Author:
alo
Message:

--

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • cherokee/trunk/ChangeLog

    r1580 r1582  
    112008-06-20  Alvaro Lopez Ortega  <alvaro@alobbs.com> 
     2 
     3        * qa/run-tests.py: Try to handle when -d (pause for debug) and 
     4        -t (pararell threads) are used together in the best possible way. 
    25 
    36        * cherokee/buffer.c (cherokee_buffer_decode_base64): Fixes an 
  • cherokee/trunk/qa/run-tests.py

    r1559 r1582  
    107107    else: 
    108108        pause = sys.maxint 
     109 
     110# Check threads and pauses 
     111if thds > 1 and pause > 1: 
     112    print "ERROR: -d and -t are incompatible with each other." 
     113    sys.exit(1) 
    109114 
    110115# Check the interpreters 
     
    291296        os.kill (pid, signal.SIGKILL) 
    292297 
    293 def mainloop_iterator(objs): 
     298def do_pause(): 
     299    global pause 
     300    print "Press <Enter> to continue.." 
     301    sys.stdin.readline() 
     302    pause = pause - 1 
     303 
     304def mainloop_iterator(objs, main_thread=True): 
    294305    global port 
    295306    global pause 
     
    312323            go_ahead = obj.Precondition() 
    313324 
    314             if go_ahead and pause > 0: 
    315                 print "Press <Enter> to continue.." 
    316                 sys.stdin.readline() 
    317                 pause = pause - 1 
     325            if go_ahead and pause > 0 and main_thread: 
     326                do_pause() 
    318327 
    319328            if not quiet: 
     
    359368    port = 443 
    360369 
     370# If we want to pause once do it before launching the threads 
     371if pause == 1: 
     372    do_pause() 
     373 
    361374# Maybe launch some threads 
    362375for n in range(thds-1): 
    363     objs_copy = map (lambda x: copy.copy(x), objs) 
    364  
    365376    t = (n * 1.0 / (thds-1)) 
    366377    time.sleep(t) 
    367378 
    368     thread.start_new_thread (mainloop_iterator, (objs_copy,)) 
     379    thread.start_new_thread (mainloop_iterator, (objs[:], False)) 
    369380 
    370381# Execute the tests