Commits

Zemian Deng committed c77040f

Removed unused script UnitTestsTime.groovy.

Comments (0)

Files changed (1)

scripts/UnitTestsTime.groovy

-// UnitTestsTime.groovy
-//   - Parse and list the Maven's surefire-reports result file tests with status, time (secs), and name.
-// Zemian Deng <saltnlight5@gmail.com>
-// 03/05/2012
-showFailed = false
-dir = new File('target/surefire-reports')
-dir.eachFile { file -> if (file.name.endsWith('.txt')) processFile(file) }
-def processFile(file) {
-	lines = file.readLines()
-	if (lines.size() == 0) {
-		if(showFailed)
-			println("FAILED 0000.0 $file.name")
-		return
-	}
-	testName = lines[1].split(' ')[2]
-	statusWords = lines[3].split(' ')
-	if (statusWords[-1] == 'FAILURE!') {
-		timeInSec = statusWords[-4]
-		status = "FAILED" 
-	} else {
-		timeInSec = statusWords[-2]
-		status = "PASSED" 
-	}
-	timeInSec = timeInSec.replaceAll(',', '') // strip away comma for conversion below.
-	timeStr = String.format("%06.1f", timeInSec.toDouble())
-	if (status == 'FAILED' && !showFailed)
-		return
-	println("$status $timeStr $testName")
-}