Skip to content

Commit

Permalink
Fix #271: relative links to input files in the HTML tables (left-most…
Browse files Browse the repository at this point in the history
… column)

are now computed correctly.

Previously, this worked only in some cases for local paths
and not at all for HTTP urls (which occurs if HTTP urls are given as
input to table-generator).
  • Loading branch information
PhilippWendler committed Nov 3, 2017
1 parent 4947115 commit 88fdadf
Show file tree
Hide file tree
Showing 97 changed files with 1,152 additions and 1,144 deletions.
24 changes: 16 additions & 8 deletions benchexec/tablegenerator/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,13 +439,19 @@ def get_column_type(column, result_set):
return ColumnType.text, None, None, 1


def get_task_id(task):
def get_task_id(task, base_path_or_url):
"""
Return a unique identifier for a given task.
@param task: the XML element that represents a task
@return a tuple with filename of task as first element
"""
task_id = [task.get('name'),
name = task.get('name')
if base_path_or_url:
if Util.is_url(base_path_or_url):
name = urllib.parse.urljoin(base_path_or_url, name)
else:
name = os.path.normpath(os.path.join(os.path.dirname(base_path_or_url), name))
task_id = [name,
task.get('properties'),
task.get('runset'),
]
Expand Down Expand Up @@ -513,7 +519,7 @@ def append(self, resultFile, resultElem, all_columns=False):
"""
Append the result for one run. Needs to be called before collect_data().
"""
self._xml_results += _get_run_tags_from_xml(resultElem)
self._xml_results += [(result, resultFile) for result in _get_run_tags_from_xml(resultElem)]
for attrib, values in RunSetResult._extract_attributes_from_result(resultFile, resultElem).items():
self.attributes[attrib].extend(values)

Expand All @@ -537,10 +543,10 @@ def get_value_from_logfile(lines, identifier):
# Opening the ZIP archive with the logs for every run is too slow, we cache it.
log_zip_cache = {}
try:
for xml_result in self._xml_results:
for xml_result, result_file in self._xml_results:
self.results.append(RunResult.create_from_xml(
xml_result, get_value_from_logfile, self.columns,
correct_only, log_zip_cache, self.columns_relevant_for_diff))
correct_only, log_zip_cache, self.columns_relevant_for_diff, result_file))
finally:
for file in log_zip_cache.values():
file.close()
Expand Down Expand Up @@ -569,7 +575,7 @@ def create_from_xml(resultFile, resultElem, columns=None,

summary = RunSetResult._extract_summary_from_result(resultElem, columns)

return RunSetResult(_get_run_tags_from_xml(resultElem),
return RunSetResult([(result, resultFile) for result in _get_run_tags_from_xml(resultElem)],
attributes, columns, summary, columns_relevant_for_diff)

@staticmethod
Expand Down Expand Up @@ -830,7 +836,8 @@ def __init__(self, task_id, status, category, score, log_file, columns,

@staticmethod
def create_from_xml(sourcefileTag, get_value_from_logfile, listOfColumns,
correct_only, log_zip_cache, columns_relevant_for_diff):
correct_only, log_zip_cache, columns_relevant_for_diff,
result_file_or_url):
'''
This function collects the values from one run.
Only columns that should be part of the table are collected.
Expand Down Expand Up @@ -914,7 +921,8 @@ def read_logfile_lines(log_file):
else:
sourcefiles_exist = False

return RunResult(get_task_id(sourcefileTag), status, category, score,
return RunResult(get_task_id(sourcefileTag, result_file_or_url if sourcefiles_exist else None),
status, category, score,
sourcefileTag.get('logfile'), listOfColumns, values,
columns_relevant_for_diff, sourcefiles_exist=sourcefiles_exist)

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
tool CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker trunk:18107 CPAchecker 1.4-svn 24ecead+ CPAchecker 1.4-svn 24ecead+ CPAchecker 1.4-svn 24ecead+ CPAchecker 1.4-svn 24ecead+ CPAchecker 1.4-svn 18152M CPAchecker 1.4-svn 18152M CPAchecker 1.4-svn 18152M CPAchecker 1.4-svn 18152M CPAchecker 1.4-svn 18152M
run set integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis integration-predicateAnalysis
test/programs/ status cputime (s) walltime (s) memUsage energy-core energy-cpu energy-external energy-uncore host status cputime (s) walltime (s) memUsage status cputime (s) walltime (s) memUsage host
benchexec/tablegenerator/test_integration/results/test/programs/ status cputime (s) walltime (s) memUsage energy-core energy-cpu energy-external energy-uncore host status cputime (s) walltime (s) memUsage status cputime (s) walltime (s) memUsage host
benchmarks/ntdrivers/floppy_true-unreach-call.i.cil.c unreach-call true 43.390031517 26.8174729347 745852928 zeus03 TIMEOUT 62.862151089 62.8372449875 700772352 TIMEOUT 62.517222762 38.0683560371 717180928 node-11
benchmarks/ssh/s3_srvr.blast.08_false-unreach-call.i.cil.c unreach-call false(reach) 47.163033008 30.4609560966 691007488 node-10 TIMEOUT 61.916739245 65.195276022 668643328 TIMEOUT 61.206533808 41.4847729206 674009088 node-22
benchmarks/ssh/s3_srvr.blast.14_false-unreach-call.i.cil.c unreach-call false(reach) 22.34712855 12.6028990746 648540160 node-21 TIMEOUT 62.123385048 62.082777977 636485632 false(reach) 39.807040074 29.0270659924 650956800 node-22
Expand Down
Loading

0 comments on commit 88fdadf

Please sign in to comment.