Browse Source

unittest clean improved

master
Dirk Alders 3 years ago
parent
commit
2f3de760fc
2 changed files with 4 additions and 18 deletions
  1. 0
    17
      run.py
  2. 4
    1
      scripts/Makefile

+ 0
- 17
run.py View File

26
 import shutil
26
 import shutil
27
 
27
 
28
 
28
 
29
-ARG_CLEAN = 'clean'
30
-ARG_RUN = 'run'
31
-ARG_FINALISE = 'finalise'
32
-ARG_TEX = 'tex'
33
-ARG_STATUS = 'status'
34
-ARG_COPY = 'copy'
35
-ARG_RELEASE = 'release'
36
-
37
 FN_DATA_COLLECTION = 'unittest.json'
29
 FN_DATA_COLLECTION = 'unittest.json'
38
 FN_TEX_REPORT = 'unittest.tex'
30
 FN_TEX_REPORT = 'unittest.tex'
39
 FN_PDF_REPORT = 'unittest.pdf'
31
 FN_PDF_REPORT = 'unittest.pdf'
161
 def unittest(options, args, unittest_folder):
153
 def unittest(options, args, unittest_folder):
162
     if 'release_testcases' in args:
154
     if 'release_testcases' in args:
163
         unittest_release_testcases(unittest_folder)
155
         unittest_release_testcases(unittest_folder)
164
-    elif 'clean' in args:
165
-        unittest_clean(unittest_folder)
166
     elif 'prepare' in args:
156
     elif 'prepare' in args:
167
         unittest_prepare(unittest_folder)
157
         unittest_prepare(unittest_folder)
168
     elif 'testrun' in args:
158
     elif 'testrun' in args:
190
                 fh.write(line + '\n')
180
                 fh.write(line + '\n')
191
 
181
 
192
 
182
 
193
-def unittest_clean(ut_folder):
194
-    output.print_header('Cleaning up...')
195
-    output.print_action('Testresults from last testrun')
196
-    for fn in os.listdir(testresults_filename(ut_folder, '')):
197
-        remove_file(testresults_filename(ut_folder, fn))
198
-
199
-
200
 def unittest_prepare(ut_folder):
183
 def unittest_prepare(ut_folder):
201
     config = imp.load_source('', jsonlog.get_ut_config(ut_folder))
184
     config = imp.load_source('', jsonlog.get_ut_config(ut_folder))
202
     #
185
     #

+ 4
- 1
scripts/Makefile View File

34
 single: testrun_single finalise compile status
34
 single: testrun_single finalise compile status
35
 
35
 
36
 clean:
36
 clean:
37
-	@$(PYT3_CMD) src/unittest/scripts/unittest.py clean
37
+	@echo "\033[1;33mCleaning up...\e[0m"
38
+	@echo "\e[1m  * Testresults from last testrunx\e[0m"
39
+	@ls testresults | xargs -i echo "    testresults/{}"
40
+	@ls testresults | xargs -i rm -f "testresults/{}"
38
 	@echo "\e[1m  * Collected coverage information\e[0m"
41
 	@echo "\e[1m  * Collected coverage information\e[0m"
39
 	@$(COV3_CMD) erase
42
 	@$(COV3_CMD) erase
40
 
43
 

Loading…
Cancel
Save