this repo has no description
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

runtests.py: generate reports in JUnit format, because it actually works in Jenkins...

+19 -22
+19 -22
tests/src/bin/runtests.py
··· 62 62 try: 63 63 time_start = time.time() 64 64 output = subprocess.check_output([dyld_command, path + ".bin"]) 65 - elapsed_time = int( (time.time()-time_start)*1e6 ) 65 + elapsed_time = (time.time()-time_start) 66 66 67 67 if output != expectedOutput: 68 68 description = "Expected output:\n" + expectedOutput + "\n\nActual output:\n" + output ··· 75 75 successful_tests[arch][plat].append({ 'test': fileName, 'output': output, 'time': elapsed_time }) 76 76 77 77 except subprocess.CalledProcessError: 78 - elapsed_time = int( (time.time()-time_start)*1e6 ) 78 + elapsed_time = (time.time()-time_start) 79 79 failed_tests[arch][plat].append({ 'test': fileName, 'output': "Non-zero exit code", 'time': elapsed_time }) 80 80 81 81 def writeTestResults(outFile, sourcesDir): 82 82 doc = Document() 83 83 file = open(outFile, "w") 84 84 85 - testLog = doc.createElement("TestLog"); 85 + testLog = doc.createElement("testsuites"); 86 86 87 87 for arch in TEST_ARCHITECTURES: 88 88 89 - archNode = doc.createElement("TestSuite") 90 - archNode.setAttribute("name", arch) 91 - 92 89 for plat in TEST_PLATFORMS: 93 90 94 - platNode = doc.createElement("TestSuite") 95 - platNode.setAttribute("name", plat) 91 + platNode = doc.createElement("testsuite") 92 + platNode.setAttribute("name", arch+"/"+plat) 93 + platNode.setAttribute("tests", str(len(failed_tests[arch][plat]) + len(successful_tests[arch][plat]))) 96 94 97 95 for test in failed_tests[arch][plat]: 98 - testNode = doc.createElement("TestCase") 96 + testNode = doc.createElement("testcase") 99 97 testNode.setAttribute("name", test['test']) 100 98 101 - errorNode = doc.createElement("Error") 102 - errorNode.setAttribute("file", sourcesDir + '/' + test['test']) 103 - errorNode.setAttribute("line", "0") 99 + errorNode = doc.createElement("failure") 100 + #errorNode.setAttribute("file", sourcesDir + '/' + test['test']) 101 + #errorNode.setAttribute("line", "0") 104 102 errorNode.appendChild(doc.createTextNode(test['output'])) 105 103 106 - timeNode = doc.createElement("TestingTime") 107 - timeNode.appendChild(doc.createTextNode(str(test['time']))) 108 - testNode.appendChild(timeNode) 104 + #timeNode = doc.createElement("TestingTime") 105 + testNode.setAttribute("time", str(test['time']) + "s") 106 + #testNode.appendChild(timeNode) 109 107 110 108 testNode.appendChild(errorNode) 111 109 platNode.appendChild(testNode) 112 110 113 111 for test in successful_tests[arch][plat]: 114 - testNode = doc.createElement("TestCase") 112 + testNode = doc.createElement("testcase") 115 113 testNode.setAttribute("name", test['test']) 116 114 117 - timeNode = doc.createElement("TestingTime") 118 - timeNode.appendChild(doc.createTextNode(str(test['time']))) 119 - testNode.appendChild(timeNode) 115 + #timeNode = doc.createElement("TestingTime") 116 + testNode.setAttribute("time", str(test['time']) + "s") 117 + #testNode.appendChild(timeNode) 120 118 platNode.appendChild(testNode) 121 119 122 - archNode.appendChild(platNode) 123 - testLog.appendChild(archNode) 120 + testLog.appendChild(platNode) 124 121 125 122 doc.appendChild(testLog) 126 - doc.writexml(file) 123 + doc.writexml(file, encoding="utf-8") 127 124 file.close() 128 125 129 126