diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 2cb058e7fd..c93d72182d 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -123,7 +123,7 @@ bool RunAutoTest(HeadlessHost *headlessHost, CoreParameter &coreParameter, bool fprintf(stderr, "Failed to start %s. Error: %s\n", coreParameter.fileToStart.c_str(), error_string.c_str()); printf("TESTERROR\n"); TeamCityPrint("##teamcity[testIgnored name='%s' message='PRX/ELF missing']\n", teamCityName.c_str()); - return 1; + return false; } TeamCityPrint("##teamcity[testStarted name='%s' captureStandardOutput='true']\n", teamCityName.c_str()); @@ -241,6 +241,17 @@ int main(int argc, const char* argv[]) testFilenames.push_back(argv[i]); } + // TODO: Allow a filename here? + if (testFilenames.size() == 1 && testFilenames[0] == "@-") + { + testFilenames.clear(); + char temp[2048]; + temp[2047] = '\0'; + + while (scanf("%2047s", temp) == 1) + testFilenames.push_back(temp); + } + if (readMount) { printUsage(argv[0], "Missing argument after -m"); diff --git a/test.py b/test.py index 1424e3aece..9fd49aac46 100755 --- a/test.py +++ b/test.py @@ -30,8 +30,9 @@ teamcity_mode = False TIMEOUT = 5 class Command(object): - def __init__(self, cmd): + def __init__(self, cmd, data = None): self.cmd = cmd + self.data = data self.process = None self.output = None self.timeout = False @@ -39,6 +40,8 @@ class Command(object): def run(self, timeout): def target(): self.process = subprocess.Popen(self.cmd, bufsize=1, stdin=subprocess.PIPE, stdout=sys.stdout, stderr=subprocess.STDOUT) + self.process.stdin.write(self.data) + self.process.stdin.close() self.process.communicate() thread = threading.Thread(target=target) @@ -306,10 +309,10 @@ def run_tests(test_list, args): if len(test_filenames): # TODO: Maybe --compare should detect --graphics? - cmdline = [PPSSPP_EXE, '--graphics', '--compare', '--timeout=' + str(TIMEOUT)] + test_filenames + cmdline = [PPSSPP_EXE, '--graphics', '--compare', '--timeout=' + str(TIMEOUT), '@-'] cmdline.extend([i for i in args if i not in ['-g']]) - c = Command(cmdline) + c = Command(cmdline, '\n'.join(test_filenames)) c.run(TIMEOUT * len(test_filenames)) print("Ran " + PPSSPP_EXE)