~kiithsacmp/miniini/trunk

« back to all changes in this revision

Viewing changes to test.py

  • Committer: Ferdinand Majerech
  • Date: 2010-07-03 21:00:30 UTC
  • Revision ID: kiithsacmp@gmail.com-20100703210030-wtvjlrn83wa4ju5v
Fixed a bug with the -k/--keep option of test.py introduced in a recent revision. Added version-compare.py , a script to benchmark and compare multiple MiniINI versions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 
17
17
 
18
18
def help():
19
 
    print ("Aggregate benchmark script")
20
 
    print ("Copyright (C) 2009-2010 Ferdinand Majerech")
21
 
    print ("Usage: test.py [OPTIONS] [ARGUMENTS]")
22
 
    print (" -h --help            display this help and exit")
23
 
    print (" -v --verbose         more detailed output - can be repeated to")
24
 
    print ("                      increase verbosity further")
25
 
    print (" -t --tool       val  specify tool to use - possible values:")
26
 
    print ("                      benchmark - run benchmarks specified in an ini")
27
 
    print ("                                  file. The first argument is the")
28
 
    print ("                                  ini file in test/ini directory.")
29
 
    print ("                                  The second is name of subdirectory")
30
 
    print ("                                  to write results to, in test/runs")
31
 
    print ("                                  directory.")
32
 
    print ("                      compare - compare two or more output")
33
 
    print ("                                directories of the benchmark tool")
34
 
    print ("                                - the first argument is the ")
35
 
    print ("                                subdirectory to output results of")
36
 
    print ("                                the comparison to, in test/comps.")
37
 
    print ("                                Other arguments are names of ")
38
 
    print ("                                directories to compare in test/runs.")
39
 
    print (" -T --bench-tools val Only applies with tool=benchmark. A string of")
40
 
    print ("                      characters specifying what benchmarking tools")
41
 
    print ("                      should be used. Valid characters:")
42
 
    print ("                      m - Memcheck")
43
 
    print ("                      c - Callgrind")
44
 
    print ("                      C - Cachegrind")
45
 
    print ("                      M - Massif")
46
 
    print ("                      t - Run time")
47
 
    print ("                      e - Extra benchmarking information provided")
48
 
    print ("                          by bin/benchmark and/or bin/benchmark-dbg")
49
 
    print ("                          compiled with -DMINIINI_BENCH_EXTRA")
50
 
    print (" -k --keep           keep all files produced by testutil.py runs, ")
51
 
    print ("                     not just summaries.")
 
19
    print("Aggregate benchmark script")
 
20
    print("Copyright (C) 2009-2010 Ferdinand Majerech")
 
21
    print("Usage: test.py [OPTIONS] [ARGUMENTS]")
 
22
    print(" -h --help            display this help and exit")
 
23
    print(" -v --verbose         more detailed output - can be repeated to")
 
24
    print("                      increase verbosity further")
 
25
    print(" -t --tool       val  specify tool to use - possible values:")
 
26
    print("                      benchmark - run benchmarks specified in an ini")
 
27
    print("                                  file. The first argument is the")
 
28
    print("                                  ini file in test/ini directory.")
 
29
    print("                                  The second is name of subdirectory")
 
30
    print("                                  to write results to, in test/runs")
 
31
    print("                                  directory.")
 
32
    print("                      compare - compare two or more output")
 
33
    print("                                directories of the benchmark tool")
 
34
    print("                                - the first argument is the ")
 
35
    print("                                subdirectory to output results of")
 
36
    print("                                the comparison to, in test/comps.")
 
37
    print("                                Other arguments are names of ")
 
38
    print("                                directories to compare in test/runs.")
 
39
    print(" -T --bench-tools val Only applies with tool=benchmark. A string of")
 
40
    print("                      characters specifying what benchmarking tools")
 
41
    print("                      should be used. Valid characters:")
 
42
    print("                      m - Memcheck")
 
43
    print("                      c - Callgrind")
 
44
    print("                      C - Cachegrind")
 
45
    print("                      M - Massif")
 
46
    print("                      t - Run time")
 
47
    print("                      e - Extra benchmarking information provided")
 
48
    print("                          by bin/benchmark and/or bin/benchmark-dbg")
 
49
    print("                          compiled with -DMINIINI_BENCH_EXTRA")
 
50
    print(" -k --keep           keep all files produced by testutil.py runs,")
 
51
    print("                     not just summaries.")
52
52
 
53
53
#run given command and return its return value
54
54
def run_cmd(cmd):
297
297
        if "e" in bench_tools:
298
298
            self.__extra_bench_tool = True
299
299
            bench_tools = bench_tools.replace("e", "")
300
 
        self.__test_base = "./testutil.py -t " + bench_tools + " -f bench-"
 
300
 
 
301
        keep = ""
 
302
        if(keep_files):
 
303
            keep = " -k "
 
304
 
 
305
        self.__test_base = ("./testutil.py -t " + bench_tools + keep + 
 
306
                            " -f bench-")
 
307
 
301
308
 
302
309
        if verbosity > 2:
303
310
            #print verbose testutil.py output
304
 
            self.__test_base = "./testutil.py -vv -t " + bench_tools + " -f bench-"
305
 
        if(keep_files):
306
 
            self.__test_base += "-k "
307
 
 
 
311
            self.__test_base = ("./testutil.py -vv -t " + bench_tools + keep + 
 
312
                                " -f bench-")
308
313
        self.__generator = FileGenerator(ini_file, ini_section)
309
314
 
310
315
    #Returns number of benchmarks to be performed by this BenchRunner