Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions tools/Python/mctest/main.template
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,17 @@ a:visited { color: lightgrey; background-color: transparent; text-decoration: no
{%- for c in row %}
{%- if loop.index0 > 0 %}
{%- if c.0 == 1 %}
<td class=state_one><a href={{ c.5 }} >C:{{ c.1 }}/<strong>R:{{ c.2 }}</strong><br><strong>I={{ c.3 }}</strong> ({{ c.4 }})</a></td>
<td class=state_one><a href={{ c.5 }} >C:{{ c.1 }}/<strong>R:{{ c.2 }}</strong><br><strong>I={{ c.3 }}</strong> ({{ c.4 }})</a>
<br><a href={{ c.7 }} ><strong>{{ c.6 }}</strong></a>
</td>
{%- elif c.0 == 2 %}
<td class=state_two><a href={{ c.5 }} >C:{{ c.1 }}/<strong>R:{{ c.2 }}</strong><br><strong>I={{ c.3 }}</strong> ({{ c.4 }})</a></td>
<td class=state_two><a href={{ c.5 }} >C:{{ c.1 }}/<strong>R:{{ c.2 }}</strong><br><strong>I={{ c.3 }}</strong> ({{ c.4 }})</a>
<br><a href={{ c.7 }} ><strong>{{ c.6 }}</strong></a>
</td>
{%- elif c.0 == 3 %}
<td class=state_three><a href={{ c.5 }} >C:{{ c.1 }}</a></td>
<td class=state_three><a href={{ c.5 }} >C:{{ c.1 }}</a>
<br><a href={{ c.7 }} ><strong>{{ c.6 }}</strong></a>
</td>
{%- else %}
<td class=state_four>
<a href={{ c.5 }} ><font color="black">{{ c.1}}</font></a>
Expand Down
23 changes: 18 additions & 5 deletions tools/Python/mctest/mctest.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def __init__(self, sourcefile, localfile, parvals=None, detector=None, targetval

self.linted = None
self.compiled = None
self.displayed = None
self.compiletime = None
self.didrun = None
self.runtime = None
Expand All @@ -88,6 +89,7 @@ def get_json_repr(self):
"linted" : self.linted,
"compiled" : self.compiled,
"compiletime" : self.compiletime,
"displayed" : self.displayed,
"didrun" : self.didrun,
"runtime" : self.runtime,
"errmsg" : self.errmsg,
Expand All @@ -113,6 +115,7 @@ def load(self,testnb=0):
self.linted=obj['linted']
self.compiled=obj['compiled']
self.compiletime=obj['compiletime']
self.displayed=obj['displayed']
self.didrun=obj['didrun']
self.runtime=obj['runtime']
self.errmsg=obj['errmsg']
Expand Down Expand Up @@ -340,10 +343,13 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt
formatstr = "%-" + "%ds: " % maxnamelen + \
"{:3d}.".format(math.floor(test.compiletime)) + str(test.compiletime-int(test.compiletime)).split('.')[1][:2]
logging.info(formatstr % test.get_display_name())
# Run mcdisplay if not openacc
if not openacc:
cmd = mccode_config.configuration["MCDISPLAY"]+'-classic --nobrowse %s -y -d display > displaylog.txt 2>&1' % (test.instrname+'.instr')
utils.run_subtool_noread(cmd, cwd=join(testdir, test.instrname), timeout=compilemax)
# Run mcdisplay (single particle only)
cmd = mccode_config.configuration["MCDISPLAY"]+'-classic --nobrowse %s -y -n1 -d display > displaylog.txt 2>&1' % (test.instrname+'.instr')
retcode = utils.run_subtool_noread(cmd, cwd=join(testdir, test.instrname), timeout=compilemax)
if retcode[0]==0:
test.displayed = True
else:
test.displayed = False
else:
if lint:
formatstr = "%-" + "%ds: Linted using using:\n" % maxnamelen
Expand Down Expand Up @@ -379,7 +385,14 @@ def mccode_test(branchdir, testdir, limitinstrs=None, instrfilter=None, compfilt
failed=True
logging.info(formatstr % test.instrname)
continue

if test.testnb <= 1:
if test.displayed:
formatstr = "%-" + "%ds: Display OK" % (maxnamelen+1)
logging.info(formatstr % test.instrname)
else:
formatstr = "%-" + "%ds: Display FAILED" % (maxnamelen+1)
logging.info(formatstr % test.instrname)

# runable tests have testnb > 0
if test.testnb <= 0:
formatstr = "%-" + "%ds: NO TEST" % (maxnamelen+1)
Expand Down
30 changes: 24 additions & 6 deletions tools/Python/mctest/mcviewtest.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,50 @@ def get_cell_tuple(cellobj, refval=None):
label = cellobj["localfile"].split("\\");

label=label[len(label)-3];
# URL for test output data in success (i.e. 1/ or 2/ etc.)
url = label + "/" + cellobj["instrname"] + "/" + str(cellobj["testnb"]) + "/"
# URL for compiling instrs - without data
burl = label + "/" + cellobj["instrname"] + "/"
# URL for instruments that failed compiling
curl = label + "/" + cellobj["instrname"] + "/compile_stdout.txt"

# Display URL if display succeeded
durl = label + "/" + cellobj["instrname"] + "/display/index.html"
# Display URL if display failed
fdurl = label + "/" + cellobj["instrname"] + "/displaylog.txt"

if cellobj["testnb"] <= 1:
if not cellobj["displayed"]:
display="<strong><font color=\"#FFA500\">DISPLAY: FAILED! (log)</font></strong>"
displayurl=fdurl
else:
display="<strong>DISPLAY: OK (link)<strong>"
displayurl=durl
else:
display=""
displayurl=""

if not cellobj["compiled"]:
if cellobj["linted"]:
state = 4
return (state, "<strong><font color=\"#8B4000\">C-linter output</font></strong>", "", "", "", curl)
return (state, "<strong><font color=\"#8B4000\">C-linter output</font></strong>", "", "", "", curl, "", "")
else:
state = 4
return (state, "<strong><font color=\"red\">! Compile error !</font></strong>", "", "", "", curl)
return (state, "<strong><font color=\"red\">! Compile error !</font></strong>", "", "", "", curl, "", "")
elif not cellobj["didrun"]:
state = 3
compiletime = "%.2f s" % cellobj["compiletime"]
if cellobj["testnb"] > 1:
# if this is a second test of the same instr, it was already compiled, thus 0.001 compiletime is nonsense
compiletime = ""
return (state, compiletime, "", "", "", burl)
return (state, compiletime, "", "", "", burl, display, displayurl)
elif cellobj["testval"]==None:
testval = "missing"
runtime = "%.2f s" % cellobj["runtime"]
compiletime = "%.2f s" % cellobj["compiletime"]
if cellobj["testnb"] > 1:
compiletime = ""
state = 2
return (state, compiletime, runtime, testval, "", url)
return (state, compiletime, runtime, testval, "", url, display, displayurl)
else:
testval = "%.2g" % float(cellobj["testval"])
runtime = "%.2f s" % cellobj["runtime"]
Expand Down Expand Up @@ -120,7 +138,7 @@ def get_cell_tuple(cellobj, refval=None):
else:
refp = "%2.f" % refp + "%"

return (state, compiletime, runtime, testval, refp, url)
return (state, compiletime, runtime, testval, refp, url, display, displayurl)

def get_empty_cell_tuple(tag=None):
''' return a "state_four" black cell, optionally with a tag, this could be "no ref" or "no test" etc. '''
Expand Down
Loading