From 9b37a8b8a72330d5f8bd6397bc83a02a7a9045f9 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 4 Sep 2020 11:54:52 +0100 Subject: [PATCH] Don't print renderdoc log to stdout when running tests --- util/test/rdtest/capture.py | 2 +- util/test/rdtest/logging.py | 4 ++-- util/test/rdtest/testresults.js | 10 +++++++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/util/test/rdtest/capture.py b/util/test/rdtest/capture.py index 35fc46186..02909053e 100644 --- a/util/test/rdtest/capture.py +++ b/util/test/rdtest/capture.py @@ -185,7 +185,7 @@ def run_and_capture(exe: str, cmdline: str, frame: int, *, capture_name=None, op captures = control.captures() if logfile is not None and os.path.exists(logfile): - log.inline_file('Process output', logfile) + log.inline_file('Process output', logfile, with_stdout=True) if len(captures) == 0: raise RuntimeError("No capture made") diff --git a/util/test/rdtest/logging.py b/util/test/rdtest/logging.py index 34288f9b4..75ae06143 100644 --- a/util/test/rdtest/logging.py +++ b/util/test/rdtest/logging.py @@ -90,13 +90,13 @@ class TestLogger: self.dedent() self.rawprint("<< Section {}".format(name)) - def inline_file(self, name: str, path: str): + def inline_file(self, name: str, path: str, with_stdout: bool = False): self.rawprint(">> Raw {}".format(name)) self.indent() with open(path) as f: lines = f.readlines() for l in lines: - self.rawprint(l.strip()) + self.rawprint(l.strip(), with_stdout=with_stdout) self.dedent() self.rawprint("<< Raw {}".format(name)) diff --git a/util/test/rdtest/testresults.js b/util/test/rdtest/testresults.js index 5a95bb63e..30dda04bd 100644 --- a/util/test/rdtest/testresults.js +++ b/util/test/rdtest/testresults.js @@ -11,15 +11,19 @@ document.body.onload = function() { function linkTests(str) { var ret = str; - console.log("Linking tests in '" + str + "'"); for(var i=0; i < test_list.length; i++) { - console.log("Checking against " + test_list[i]); ret = ret.replace(new RegExp('([^#">])\\b' + test_list[i] + '\\b', "g"), '$1' + test_list[i] + ''); } - console.log("Got ret: " + ret) return ret; } + window.onhashchange = function() { + test = window.location.hash.substr(1) + if(test_list.indexOf(test) >= 0) { + document.getElementById(test).classList.add('expanded'); + } + } + function formatDiff(diff) { var difflines = diff.split('\n')