File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1212 CPYTHON3 = 'python3.3'
1313 MP_PY = '../unix/micropython'
1414
15+ def rm_f (fname ):
16+ if os .path .exists (fname ):
17+ os .remove (fname )
18+
1519test_count = 0
1620testcase_count = 0
1721passed_count = 0
@@ -30,14 +34,20 @@ for test_file in tests:
3034 try :
3135 output_mupy = subprocess .check_output ([MP_PY , test_file ])
3236 except subprocess .CalledProcessError :
33- output_mupy = 'CRASH'
37+ output_mupy = b 'CRASH'
3438
3539 testcase_count += len (output_expected .splitlines ())
3640
3741 if output_expected == output_mupy :
3842 print ("pass " , test_file )
3943 passed_count += 1
44+ rm_f (os .path .basename (test_file + ".exp" ))
45+ rm_f (os .path .basename (test_file + ".out" ))
4046 else :
47+ with open (os .path .basename (test_file + ".exp" ), "w" ) as f :
48+ f .write (str (output_expected , "ascii" ))
49+ with open (os .path .basename (test_file + ".out" ), "w" ) as f :
50+ f .write (str (output_mupy , "ascii" ))
4151 print ("FAIL " , test_file )
4252 failed_tests .append (test_name )
4353
You can’t perform that action at this time.
0 commit comments