From df744868c54f115de59c682ea1ed68621aa31fb0 Mon Sep 17 00:00:00 2001 From: Christophe Favergeon Date: Wed, 13 May 2020 15:56:15 +0200 Subject: [PATCH] CMSIS-DSP: Improved script for generating test reports. --- Testing/extractDb.py | 29 +++++++++++++++++++++++++---- 1 file changed, 25 insertions(+), 4 deletions(-) diff --git a/Testing/extractDb.py b/Testing/extractDb.py index 13595bd9..eadc0289 100755 --- a/Testing/extractDb.py +++ b/Testing/extractDb.py @@ -93,6 +93,18 @@ benchCmd="""select %s from %s WHERE compiler=? AND VERSION=? AND typeid = ? AND runid = ? """ +# Command to get data for specific compiler +# and type +nbElemsCmd="""select count(*) from %s + INNER JOIN CATEGORY USING(categoryid) + INNER JOIN PLATFORM USING(platformid) + INNER JOIN CORE USING(coreid) + INNER JOIN COMPILER USING(compilerid) + INNER JOIN COMPILERKIND USING(compilerkindid) + INNER JOIN TYPE USING(typeid) + WHERE compiler=? AND VERSION=? AND typeid = ? AND runid = ? + """ + # Command to get test names for specific compiler # and type benchNames="""select distinct NAME from %s @@ -134,6 +146,12 @@ def getTestNames(benchTable,comp,typeid): result=c.execute(benchNames % benchTable,vals).fetchall() return([x[0] for x in list(result)]) +# Get nb elems in a table +def getNbElems(benchTable,comp,typeid): + vals=(comp[0],comp[1],typeid,runid) + result=c.execute(nbElemsCmd % benchTable,vals).fetchone() + return(result[0]) + # Get names of columns and data for a table # for specific typeid and compiler (for the data) def getColNamesAndData(benchTable,comp,typeid): @@ -263,10 +281,13 @@ def addReportFor(output,benchName): allCompilers = getExistingCompiler(benchName,aTypeID) for compiler in allCompilers: #print(compiler) - output.write("### %s (%s)\n" % compiler) - cols,vals=getColNamesAndData(benchName,compiler,aTypeID) - names=getTestNames(benchName,compiler,aTypeID) - formatTableByCore(output,names,cols,vals) + nbElems = getNbElems(benchName,compiler,aTypeID) + # Print test results for table, type, compiler + if nbElems > 0: + output.write("### %s (%s)\n" % compiler) + cols,vals=getColNamesAndData(benchName,compiler,aTypeID) + names=getTestNames(benchName,compiler,aTypeID) + formatTableByCore(output,names,cols,vals)