equal
deleted
inserted
replaced
1 |
1 |
2 from raptor_tests import SmokeTest, ReplaceEnvs |
2 from raptor_tests import SmokeTest, ReplaceEnvs |
|
3 import os |
3 |
4 |
4 def generate_files(): |
5 def generate_files(): |
5 import os |
|
6 |
6 |
7 bldinf_path = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time/bld.inf") |
7 bldinf_path = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time/bld.inf") |
8 bldinf = open(bldinf_path, "w") |
8 bldinf = open(bldinf_path, "w") |
9 bldinf_content = """/* |
9 bldinf_content = """/* |
10 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
10 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
25 */ |
25 */ |
26 |
26 |
27 prj_mmpfiles |
27 prj_mmpfiles |
28 """ |
28 """ |
29 test_dir = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time") |
29 test_dir = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time") |
30 for number in range(0, 500): |
30 for number in range(0, 250): |
31 mmp_path = ("parse_timing_" + str(number).zfill(3) + ".mmp") |
31 mmp_path = ("parse_timing_" + str(number).zfill(3) + ".mmp") |
32 mmp_file = open((test_dir + "/" + mmp_path), "w") |
32 mmp_file = open((test_dir + "/" + mmp_path), "w") |
33 mmp_file.write("""/* |
33 mmp_file.write("""/* |
34 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
34 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
35 * All rights reserved. |
35 * All rights reserved. |
59 try: |
59 try: |
60 os.mkdir(test_dir + "/" + source_dir) |
60 os.mkdir(test_dir + "/" + source_dir) |
61 except: |
61 except: |
62 pass |
62 pass |
63 |
63 |
64 for number2 in range (0, 5): |
64 for number2 in range (0, 10): |
65 source_file = ("/file_" + str(number2) + ".txt ") |
65 source_file = ("/file_" + str(number2) + ".txt ") |
66 export_file = open((test_dir + "/" + source_dir + source_file), "w") |
66 export_file = open((test_dir + "/" + source_dir + source_file), "w") |
67 export_file.write(str(number2)) |
67 export_file.write(str(number2)) |
68 export_file.close() |
68 export_file.close() |
69 |
69 |
79 |
79 |
80 |
80 |
81 def delete_files(): |
81 def delete_files(): |
82 import shutil |
82 import shutil |
83 |
83 |
84 test_dir = "$(SBS_HOME)/test/timing_tests/test_resources/parse_time" |
84 test_dir = ReplaceEnvs("$(SBS_HOME)/test/timing_tests/test_resources/parse_time") |
85 objects = os.listdir(test_dir) |
85 objects = os.listdir(test_dir) |
86 for object in objects: |
86 for object in objects: |
87 if os.path.isfile(object): |
87 object_path = (test_dir + "/" + object) |
88 os.remove(object) |
88 if os.path.isfile(object_path): |
|
89 os.remove(object_path) |
89 else: |
90 else: |
90 shutil.rmtree(object) |
91 shutil.rmtree(object_path) |
91 |
92 |
92 |
93 |
93 def run(): |
94 def run(): |
94 |
95 |
95 generate_files() |
96 generate_files() |
98 |
99 |
99 t.id = "1" |
100 t.id = "1" |
100 t.name = "parse_time_exports_mmps" |
101 t.name = "parse_time_exports_mmps" |
101 t.description = """Test to measure time taken to parse a large number of |
102 t.description = """Test to measure time taken to parse a large number of |
102 exports and mmps""" |
103 exports and mmps""" |
103 t.command = "sbs -b timing_tests/test_resources/parse_time/bld.inf " + \ |
104 t.command = "sbs -b timing_tests/test_resources/parse_time/bld.inf -n " + \ |
104 "-c armv5_urel" |
105 "-c armv5_urel --toolcheck=off --timing" |
105 t.run() |
106 t.run() |
106 |
107 |
107 delete_files() |
108 delete_files() |
108 return t |
109 return t |