diff options
author | Steven Knight <knight@baldmt.com> | 2005-10-10 02:49:11 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2005-10-10 02:49:11 (GMT) |
commit | fb3e4847942786fed2f7b10a1da35e1c0ef92513 (patch) | |
tree | e6bf38b4bb60546638faf52593a367b87099c8d9 /test/option--debug.py | |
parent | 04b10a2b9a5d1be08e3884c2f3ee641359b86989 (diff) | |
download | SCons-fb3e4847942786fed2f7b10a1da35e1c0ef92513.zip SCons-fb3e4847942786fed2f7b10a1da35e1c0ef92513.tar.gz SCons-fb3e4847942786fed2f7b10a1da35e1c0ef92513.tar.bz2 |
Fix on-disk file matching on case-insensitive systems. Various fixes for win32 portability. Refactor the --debug=time test. Refactor the Perforce test. Additional cleanup.
Diffstat (limited to 'test/option--debug.py')
-rw-r--r-- | test/option--debug.py | 53 |
1 files changed, 1 insertions, 52 deletions
diff --git a/test/option--debug.py b/test/option--debug.py index bc383e8..ce0aed4 100644 --- a/test/option--debug.py +++ b/test/option--debug.py @@ -66,63 +66,12 @@ test.write('bar.h', """ """) ############################ -# test --debug=time +# test --debug=pdb test.run(arguments = "--debug=pdb", stdin = "n\ns\nq\n") test.fail_test(string.find(test.stdout(), "(Pdb)") == -1) test.fail_test(string.find(test.stdout(), "scons") == -1) -test.write('foo.c', r""" -#include "foo.h" - -int main(int argc, char *argv[]) -{ - argv[argc++] = "--"; - printf("f1.c\n"); - exit (0); -} -""") - -test.write('bar.c', """ -#include "bar.h" - -""") - -############################ -# test --debug=time - -def num(match, line): - return float(re.match(match, line).group(1)) - -start_time = time.time() -test.run(program=TestSCons.python, arguments='-c pass') -overhead = time.time() - start_time - -start_time = time.time() -test.run(arguments = "--debug=time .") -expected_total_time = time.time() - start_time - overhead -line = string.split(test.stdout(), '\n') - -cmdline = filter(lambda x: x[:23] == "Command execution time:", line) - -expected_command_time = num(r'Command execution time: (\d+\.\d+) seconds', cmdline[0]) -expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', cmdline[1]) -expected_command_time = expected_command_time + num(r'Command execution time: (\d+\.\d+) seconds', cmdline[2]) - -totalline = filter(lambda x: x[:6] == "Total ", line) - -total_time = num(r'Total build time: (\d+\.\d+) seconds', totalline[0]) -sconscript_time = num(r'Total SConscript file execution time: (\d+\.\d+) seconds', totalline[1]) -scons_time = num(r'Total SCons execution time: (\d+\.\d+) seconds', totalline[2]) -command_time = num(r'Total command execution time: (\d+\.\d+) seconds', totalline[3]) - -def check(expected, actual, tolerance): - return abs((expected-actual)/actual) <= tolerance - -assert check(expected_command_time, command_time, 0.01) -assert check(total_time, sconscript_time+scons_time+command_time, 0.01) -assert check(total_time, expected_total_time, 0.1) - ############################ # test --debug=presub |