2012-12-15 10:27:40 +00:00
|
|
|
#!/usr/bin/env python
|
2012-11-09 09:43:11 +00:00
|
|
|
# Automated script to run the pspautotests test suite in PPSSPP.
|
|
|
|
|
|
|
|
import sys
|
|
|
|
import os
|
|
|
|
import subprocess
|
2012-11-18 21:35:08 +00:00
|
|
|
import threading
|
2013-03-24 05:36:46 +00:00
|
|
|
import glob
|
|
|
|
|
|
|
|
|
|
|
|
PPSSPP_EXECUTABLES = [
|
|
|
|
# Windows
|
|
|
|
"Windows\\Debug\\PPSSPPHeadless.exe",
|
|
|
|
"Windows\\Release\\PPSSPPHeadless.exe",
|
|
|
|
"Windows\\x64\\Debug\\PPSSPPHeadless.exe",
|
|
|
|
"Windows\\x64\\Release\\PPSSPPHeadless.exe",
|
|
|
|
# Mac
|
|
|
|
"build*/Debug/PPSSPPHeadless",
|
|
|
|
"build*/Release/PPSSPPHeadless",
|
|
|
|
"build*/RelWithDebInfo/PPSSPPHeadless",
|
2013-03-24 07:39:24 +00:00
|
|
|
"build*/MinSizeRel/PPSSPPHeadless",
|
2013-03-24 05:36:46 +00:00
|
|
|
# Linux
|
2013-03-24 07:32:57 +00:00
|
|
|
"build*/PPSSPPHeadless",
|
|
|
|
"./PPSSPPHeadless"
|
2013-03-24 05:36:46 +00:00
|
|
|
]
|
2012-11-09 09:43:11 +00:00
|
|
|
|
|
|
|
PPSSPP_EXE = None
|
|
|
|
TEST_ROOT = "pspautotests/tests/"
|
2012-11-12 02:12:01 +00:00
|
|
|
teamcity_mode = False
|
2012-11-18 21:35:08 +00:00
|
|
|
TIMEOUT = 5
|
|
|
|
|
|
|
|
class Command(object):
|
|
|
|
def __init__(self, cmd):
|
|
|
|
self.cmd = cmd
|
|
|
|
self.process = None
|
|
|
|
self.output = None
|
|
|
|
self.timeout = False
|
|
|
|
|
|
|
|
def run(self, timeout):
|
|
|
|
def target():
|
|
|
|
self.process = subprocess.Popen(self.cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE)
|
|
|
|
self.output, _ = self.process.communicate()
|
2012-12-15 10:27:40 +00:00
|
|
|
self.output = self.output.decode("utf-8")
|
2012-11-18 21:35:08 +00:00
|
|
|
|
|
|
|
thread = threading.Thread(target=target)
|
|
|
|
thread.start()
|
|
|
|
|
|
|
|
thread.join(timeout)
|
2013-03-24 05:49:01 +00:00
|
|
|
if thread.isAlive():
|
2012-11-18 21:35:08 +00:00
|
|
|
self.timeout = True
|
2013-03-24 05:57:49 +00:00
|
|
|
if sys.version_info < (2, 6):
|
2013-03-29 08:22:36 +00:00
|
|
|
os.kill(self.process.pid, signal.SIGKILL)
|
2013-03-24 05:57:49 +00:00
|
|
|
else:
|
2013-03-29 08:22:36 +00:00
|
|
|
self.process.terminate()
|
2012-11-18 21:35:08 +00:00
|
|
|
thread.join()
|
2012-11-09 09:43:11 +00:00
|
|
|
|
|
|
|
# Test names are the C files without the .c extension.
|
|
|
|
# These have worked and should keep working always - regression tests.
|
|
|
|
tests_good = [
|
2012-11-29 13:40:11 +00:00
|
|
|
"cpu/cpu_alu/cpu_alu",
|
2013-03-17 18:24:35 +00:00
|
|
|
"cpu/vfpu/vector",
|
|
|
|
"cpu/vfpu/matrix",
|
|
|
|
"cpu/vfpu/convert",
|
2013-03-16 09:39:54 +00:00
|
|
|
"cpu/vfpu/prefixes",
|
2013-03-17 18:24:35 +00:00
|
|
|
"cpu/vfpu/colors",
|
|
|
|
"cpu/vfpu/gum",
|
2012-11-09 09:43:11 +00:00
|
|
|
"cpu/icache/icache",
|
|
|
|
"cpu/lsu/lsu",
|
2012-11-09 10:20:39 +00:00
|
|
|
"cpu/fpu/fpu",
|
2012-11-09 10:33:22 +00:00
|
|
|
|
2013-08-19 02:04:21 +00:00
|
|
|
"audio/atrac/ids",
|
2013-09-02 00:01:48 +00:00
|
|
|
"audio/mp3/mp3test",
|
|
|
|
"audio/sascore/sascore",
|
2012-12-03 01:19:57 +00:00
|
|
|
"ctrl/ctrl",
|
2012-12-23 05:28:01 +00:00
|
|
|
"ctrl/idle/idle",
|
2012-12-03 01:19:57 +00:00
|
|
|
"ctrl/sampling/sampling",
|
2012-12-23 05:28:01 +00:00
|
|
|
"ctrl/sampling2/sampling2",
|
2012-11-09 10:33:22 +00:00
|
|
|
"display/display",
|
2013-03-09 21:41:42 +00:00
|
|
|
"display/vblankmulti",
|
2012-11-09 10:33:22 +00:00
|
|
|
"dmac/dmactest",
|
2013-05-11 18:54:43 +00:00
|
|
|
"hle/check_not_used_uids",
|
2012-11-09 10:33:22 +00:00
|
|
|
"intr/intr",
|
|
|
|
"intr/vblank/vblank",
|
2013-05-11 18:54:43 +00:00
|
|
|
"io/cwd/cwd",
|
|
|
|
"loader/bss/bss",
|
|
|
|
"malloc/malloc",
|
2012-11-09 10:33:22 +00:00
|
|
|
"misc/testgp",
|
2013-01-06 01:24:47 +00:00
|
|
|
"misc/libc",
|
|
|
|
"misc/dcache",
|
2013-02-24 03:31:03 +00:00
|
|
|
"mstick/mstick",
|
2012-11-09 10:33:22 +00:00
|
|
|
"string/string",
|
2013-08-19 02:04:21 +00:00
|
|
|
"sysmem/freesize",
|
2012-11-09 12:00:36 +00:00
|
|
|
"gpu/callbacks/ge_callbacks",
|
2012-12-21 08:23:55 +00:00
|
|
|
"threads/alarm/alarm",
|
2012-12-21 20:38:12 +00:00
|
|
|
"threads/alarm/cancel/cancel",
|
|
|
|
"threads/alarm/refer/refer",
|
|
|
|
"threads/alarm/set/set",
|
2013-02-24 03:31:03 +00:00
|
|
|
"threads/callbacks/callbacks",
|
2012-12-15 05:25:29 +00:00
|
|
|
"threads/events/events",
|
2012-12-15 05:32:06 +00:00
|
|
|
"threads/events/cancel/cancel",
|
|
|
|
"threads/events/clear/clear",
|
|
|
|
"threads/events/create/create",
|
|
|
|
"threads/events/delete/delete",
|
|
|
|
"threads/events/poll/poll",
|
|
|
|
"threads/events/refer/refer",
|
|
|
|
"threads/events/set/set",
|
|
|
|
"threads/events/wait/wait",
|
2013-08-27 06:20:03 +00:00
|
|
|
"threads/fpl/fpl",
|
|
|
|
"threads/fpl/allocate",
|
|
|
|
"threads/fpl/cancel",
|
|
|
|
"threads/fpl/create",
|
|
|
|
"threads/fpl/delete",
|
|
|
|
"threads/fpl/free",
|
|
|
|
"threads/fpl/priority",
|
|
|
|
"threads/fpl/tryallocate",
|
2013-01-04 16:06:36 +00:00
|
|
|
"threads/k0/k0",
|
2013-02-25 06:51:55 +00:00
|
|
|
"threads/lwmutex/create",
|
|
|
|
"threads/lwmutex/delete",
|
|
|
|
"threads/lwmutex/lock",
|
|
|
|
"threads/lwmutex/priority",
|
|
|
|
"threads/lwmutex/refer",
|
|
|
|
"threads/lwmutex/try",
|
|
|
|
"threads/lwmutex/try600",
|
|
|
|
"threads/lwmutex/unlock",
|
2012-11-10 22:17:37 +00:00
|
|
|
"threads/mbx/mbx",
|
2012-12-17 07:01:43 +00:00
|
|
|
"threads/mbx/cancel/cancel",
|
|
|
|
"threads/mbx/create/create",
|
|
|
|
"threads/mbx/delete/delete",
|
|
|
|
"threads/mbx/poll/poll",
|
|
|
|
"threads/mbx/priority/priority",
|
|
|
|
"threads/mbx/receive/receive",
|
|
|
|
"threads/mbx/refer/refer",
|
|
|
|
"threads/mbx/send/send",
|
2013-08-19 02:04:21 +00:00
|
|
|
"threads/msgpipe/msgpipe",
|
|
|
|
"threads/msgpipe/cancel",
|
|
|
|
"threads/msgpipe/create",
|
|
|
|
"threads/msgpipe/data",
|
|
|
|
"threads/msgpipe/delete",
|
|
|
|
"threads/msgpipe/receive",
|
|
|
|
"threads/msgpipe/refer",
|
|
|
|
"threads/msgpipe/send",
|
|
|
|
"threads/msgpipe/tryreceive",
|
|
|
|
"threads/msgpipe/trysend",
|
2013-08-27 06:20:03 +00:00
|
|
|
"threads/mutex/cancel",
|
2013-02-25 06:51:55 +00:00
|
|
|
"threads/mutex/create",
|
|
|
|
"threads/mutex/delete",
|
|
|
|
"threads/mutex/lock",
|
2012-12-08 03:01:31 +00:00
|
|
|
"threads/mutex/mutex",
|
2013-02-25 06:51:55 +00:00
|
|
|
"threads/mutex/priority",
|
|
|
|
"threads/mutex/refer",
|
|
|
|
"threads/mutex/try",
|
|
|
|
"threads/mutex/unlock",
|
2012-11-12 16:16:16 +00:00
|
|
|
"threads/semaphores/semaphores",
|
2013-05-19 00:35:36 +00:00
|
|
|
"threads/semaphores/cancel",
|
|
|
|
"threads/semaphores/create",
|
|
|
|
"threads/semaphores/delete",
|
|
|
|
"threads/semaphores/poll",
|
|
|
|
"threads/semaphores/priority",
|
|
|
|
"threads/semaphores/refer",
|
|
|
|
"threads/semaphores/signal",
|
|
|
|
"threads/semaphores/wait",
|
|
|
|
"threads/threads/extend",
|
2013-02-24 03:31:03 +00:00
|
|
|
"threads/threads/release",
|
|
|
|
"threads/threads/rotate",
|
2013-08-19 02:04:21 +00:00
|
|
|
"threads/threads/suspend",
|
2013-02-24 03:31:03 +00:00
|
|
|
"threads/threads/threadend",
|
|
|
|
"threads/threads/threads",
|
2013-05-11 18:54:43 +00:00
|
|
|
"threads/wakeup/wakeup",
|
2013-02-24 03:31:03 +00:00
|
|
|
"threads/vpl/cancel",
|
2013-02-09 09:19:02 +00:00
|
|
|
"threads/vpl/delete",
|
|
|
|
"threads/vpl/free",
|
|
|
|
"threads/vpl/priority",
|
|
|
|
"threads/vpl/refer",
|
|
|
|
"threads/vpl/try",
|
2013-02-24 03:31:03 +00:00
|
|
|
"threads/vpl/vpl",
|
2013-08-19 02:04:21 +00:00
|
|
|
"utility/savedata/filelist",
|
2013-04-20 16:39:12 +00:00
|
|
|
"utility/systemparam/systemparam",
|
2012-11-11 18:30:48 +00:00
|
|
|
"power/power",
|
2013-08-27 06:20:03 +00:00
|
|
|
"power/volatile/lock",
|
|
|
|
"power/volatile/trylock",
|
|
|
|
"power/volatile/unlock",
|
2012-11-11 21:38:19 +00:00
|
|
|
"umd/callbacks/umd",
|
2012-12-15 05:32:06 +00:00
|
|
|
"umd/wait/wait",
|
2012-11-14 21:24:57 +00:00
|
|
|
"io/directory/directory",
|
2012-11-12 13:35:10 +00:00
|
|
|
]
|
2012-11-09 09:43:11 +00:00
|
|
|
|
2012-11-12 13:35:10 +00:00
|
|
|
tests_next = [
|
2013-02-24 03:31:03 +00:00
|
|
|
# These are the next tests up for fixing. These run by default.
|
|
|
|
"audio/atrac/atractest",
|
2013-08-27 06:20:03 +00:00
|
|
|
"audio/sceaudio/datalen",
|
|
|
|
"audio/sceaudio/output",
|
|
|
|
"audio/sceaudio/reserve",
|
2013-05-11 18:54:43 +00:00
|
|
|
"threads/scheduling/dispatch",
|
2012-11-12 13:35:10 +00:00
|
|
|
"threads/scheduling/scheduling",
|
2013-06-06 07:08:59 +00:00
|
|
|
"threads/threads/change",
|
2013-02-24 03:31:03 +00:00
|
|
|
"threads/threads/create",
|
2013-05-11 18:54:43 +00:00
|
|
|
"threads/threads/refer",
|
|
|
|
"threads/threads/start",
|
2013-08-19 02:04:21 +00:00
|
|
|
"threads/threads/terminate",
|
2012-11-12 13:35:10 +00:00
|
|
|
"threads/vtimers/vtimer",
|
2013-02-09 09:19:02 +00:00
|
|
|
"threads/vpl/allocate",
|
|
|
|
"threads/vpl/create",
|
2013-08-19 02:04:21 +00:00
|
|
|
"utility/savedata/autosave",
|
|
|
|
"utility/savedata/getsize",
|
|
|
|
"utility/savedata/idlist",
|
|
|
|
"utility/savedata/makedata",
|
|
|
|
"utility/savedata/sizes",
|
2013-02-24 03:31:03 +00:00
|
|
|
"gpu/commands/basic",
|
2013-05-11 18:54:43 +00:00
|
|
|
"gpu/commands/material",
|
2013-02-24 03:31:03 +00:00
|
|
|
"gpu/complex/complex",
|
|
|
|
"gpu/displaylist/state",
|
|
|
|
"gpu/reflection/reflection",
|
|
|
|
"gpu/rendertarget/rendertarget",
|
|
|
|
"gpu/signals/jumps",
|
|
|
|
"gpu/signals/simple",
|
2012-11-09 12:00:36 +00:00
|
|
|
"gpu/simple/simple",
|
|
|
|
"gpu/triangle/triangle",
|
|
|
|
"font/fonttest",
|
2013-02-24 03:31:03 +00:00
|
|
|
"io/file/file",
|
2013-08-19 02:04:21 +00:00
|
|
|
"io/file/rename",
|
2012-11-09 10:33:22 +00:00
|
|
|
"io/io/io",
|
|
|
|
"io/iodrv/iodrv",
|
|
|
|
"modules/loadexec/loader",
|
2012-11-23 07:46:38 +00:00
|
|
|
"rtc/rtc",
|
2013-02-28 06:54:41 +00:00
|
|
|
"sysmem/partition",
|
2013-02-24 03:31:03 +00:00
|
|
|
"sysmem/sysmem",
|
2012-11-09 10:33:22 +00:00
|
|
|
"umd/io/umd_io",
|
2012-11-30 20:50:52 +00:00
|
|
|
"umd/raw_access/raw_access",
|
2013-08-19 02:04:21 +00:00
|
|
|
"video/mpeg/basic",
|
2012-11-30 20:50:52 +00:00
|
|
|
"video/pmf/pmf",
|
|
|
|
"video/pmf_simple/pmf_simple",
|
2013-08-19 02:04:21 +00:00
|
|
|
"video/psmfplayer/basic",
|
2012-11-12 02:12:01 +00:00
|
|
|
]
|
|
|
|
|
2012-11-11 17:44:20 +00:00
|
|
|
# These don't even run (or run correctly) on the real PSP
|
|
|
|
test_broken = [
|
|
|
|
]
|
|
|
|
|
|
|
|
|
2012-11-09 09:43:11 +00:00
|
|
|
# These are the tests we ignore (not important, or impossible to run)
|
|
|
|
tests_ignored = [
|
2012-11-09 10:33:22 +00:00
|
|
|
"kirk/kirk",
|
|
|
|
"me/me",
|
2012-11-09 11:32:35 +00:00
|
|
|
|
|
|
|
"umd/umd", # mostly fixed but output seems broken? (first retval of unregister...)
|
2012-11-09 09:43:11 +00:00
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def init():
|
|
|
|
global PPSSPP_EXE
|
|
|
|
if not os.path.exists("pspautotests"):
|
2012-12-15 10:27:40 +00:00
|
|
|
print("Please run git submodule init; git submodule update;")
|
2012-11-09 09:43:11 +00:00
|
|
|
sys.exit(1)
|
|
|
|
|
2012-11-29 13:40:11 +00:00
|
|
|
if not os.path.exists(TEST_ROOT + "cpu/cpu_alu/cpu_alu.prx"):
|
2012-12-15 10:27:40 +00:00
|
|
|
print("Please install the pspsdk and run make in common/ and in all the tests")
|
|
|
|
print("(checked for existence of cpu/cpu_alu/cpu_alu.prx)")
|
2012-11-09 09:43:11 +00:00
|
|
|
sys.exit(1)
|
|
|
|
|
2013-03-24 05:36:46 +00:00
|
|
|
possible_exes = [glob.glob(f) for f in PPSSPP_EXECUTABLES]
|
|
|
|
possible_exes = [x for sublist in possible_exes for x in sublist]
|
|
|
|
existing = filter(os.path.exists, possible_exes)
|
|
|
|
if existing:
|
|
|
|
PPSSPP_EXE = max((os.path.getmtime(f), f) for f in existing)[1]
|
|
|
|
else:
|
|
|
|
PPSSPP_EXE = None
|
2012-11-09 09:43:11 +00:00
|
|
|
|
|
|
|
if not PPSSPP_EXE:
|
2012-12-15 10:27:40 +00:00
|
|
|
print("PPSSPP executable missing, please build one.")
|
2012-11-09 09:43:11 +00:00
|
|
|
sys.exit(1)
|
|
|
|
|
2012-11-12 02:12:01 +00:00
|
|
|
def tcprint(arg):
|
|
|
|
global teamcity_mode
|
|
|
|
if teamcity_mode:
|
2012-12-15 10:27:40 +00:00
|
|
|
print(arg)
|
2012-11-09 09:43:11 +00:00
|
|
|
|
2012-11-09 12:00:36 +00:00
|
|
|
def run_tests(test_list, args):
|
2012-11-18 21:35:08 +00:00
|
|
|
global PPSSPP_EXE, TIMEOUT
|
2012-11-09 10:03:01 +00:00
|
|
|
tests_passed = []
|
|
|
|
tests_failed = []
|
2012-12-15 10:27:40 +00:00
|
|
|
|
2012-11-09 09:43:11 +00:00
|
|
|
for test in test_list:
|
2012-11-11 14:05:40 +00:00
|
|
|
# Try prx first
|
2012-11-09 09:43:11 +00:00
|
|
|
expected_filename = TEST_ROOT + test + ".expected"
|
2012-11-11 15:46:25 +00:00
|
|
|
|
2012-11-11 14:05:40 +00:00
|
|
|
elf_filename = TEST_ROOT + test + ".prx"
|
2012-12-15 10:27:40 +00:00
|
|
|
print(elf_filename)
|
2012-11-11 14:05:40 +00:00
|
|
|
|
|
|
|
if not os.path.exists(elf_filename):
|
2012-12-15 10:27:40 +00:00
|
|
|
print("WARNING: no prx, trying elf")
|
2012-11-11 14:05:40 +00:00
|
|
|
elf_filename = TEST_ROOT + test + ".elf"
|
|
|
|
|
|
|
|
if not os.path.exists(elf_filename):
|
|
|
|
print("ERROR: PRX/ELF file missing, failing test: " + test)
|
|
|
|
tests_failed.append(test)
|
2012-11-12 02:12:01 +00:00
|
|
|
tcprint("##teamcity[testIgnored name='%s' message='PRX/ELF missing']" % test)
|
2012-11-11 14:05:40 +00:00
|
|
|
continue
|
|
|
|
|
2012-11-09 09:43:11 +00:00
|
|
|
if not os.path.exists(expected_filename):
|
2012-11-11 14:05:40 +00:00
|
|
|
print("WARNING: expects file missing, failing test: " + test)
|
2012-11-09 10:03:01 +00:00
|
|
|
tests_failed.append(test)
|
2012-11-12 02:12:01 +00:00
|
|
|
tcprint("##teamcity[testIgnored name='%s' message='Expects file missing']" % test)
|
2012-11-09 09:43:11 +00:00
|
|
|
continue
|
|
|
|
|
2012-11-23 17:41:46 +00:00
|
|
|
expected_output = open(expected_filename).read().strip()
|
2012-12-15 10:27:40 +00:00
|
|
|
|
2012-11-12 02:12:01 +00:00
|
|
|
tcprint("##teamcity[testStarted name='%s' captureStandardOutput='true']" % test)
|
2012-11-09 09:43:11 +00:00
|
|
|
|
2012-11-18 21:35:08 +00:00
|
|
|
cmdline = [PPSSPP_EXE, elf_filename]
|
2012-11-25 05:45:32 +00:00
|
|
|
cmdline.extend([i for i in args if i not in ['-v', '-g']])
|
2013-01-14 00:35:34 +00:00
|
|
|
if os.path.exists(expected_filename + ".bmp"):
|
|
|
|
cmdline.extend(["--screenshot=" + expected_filename + ".bmp", "--graphics"])
|
2012-11-18 21:35:08 +00:00
|
|
|
|
|
|
|
c = Command(cmdline)
|
|
|
|
c.run(TIMEOUT)
|
|
|
|
|
|
|
|
output = c.output.strip()
|
2012-12-15 10:27:40 +00:00
|
|
|
|
2012-11-18 21:35:08 +00:00
|
|
|
if c.timeout:
|
2012-12-15 10:27:40 +00:00
|
|
|
print(output)
|
|
|
|
print("Test exceded limit of %d seconds." % TIMEOUT)
|
2013-02-09 09:07:45 +00:00
|
|
|
tests_failed.append(test)
|
2012-11-18 21:35:08 +00:00
|
|
|
tcprint("##teamcity[testFailed name='%s' message='Test timeout']" % test)
|
|
|
|
tcprint("##teamcity[testFinished name='%s']" % test)
|
|
|
|
continue
|
2012-11-09 10:03:01 +00:00
|
|
|
|
|
|
|
if output.startswith("TESTERROR"):
|
2012-12-15 10:27:40 +00:00
|
|
|
print("Failed to run test " + elf_filename + "!")
|
2012-11-09 10:03:01 +00:00
|
|
|
tests_failed.append(test)
|
2012-11-12 02:12:01 +00:00
|
|
|
tcprint("##teamcity[testFailed name='%s' message='Failed to run test']" % test)
|
|
|
|
tcprint("##teamcity[testFinished name='%s']" % test)
|
2012-11-09 10:03:01 +00:00
|
|
|
continue
|
|
|
|
|
|
|
|
different = False
|
2012-11-23 17:41:46 +00:00
|
|
|
expected_lines = [x.strip() for x in expected_output.splitlines()]
|
|
|
|
output_lines = [x.strip() for x in output.splitlines()]
|
2012-12-15 10:27:40 +00:00
|
|
|
|
2012-11-11 14:05:40 +00:00
|
|
|
for i in range(0, min(len(output_lines), len(expected_lines))):
|
2012-11-09 10:03:01 +00:00
|
|
|
if output_lines[i] != expected_lines[i]:
|
2012-12-15 10:27:40 +00:00
|
|
|
print("E%i < %s" % (i + 1, expected_lines[i]))
|
|
|
|
print("O%i > %s" % (i + 1, output_lines[i]))
|
2012-11-09 10:03:01 +00:00
|
|
|
different = True
|
|
|
|
|
2012-11-11 14:05:40 +00:00
|
|
|
if len(output_lines) != len(expected_lines):
|
2012-11-23 17:33:40 +00:00
|
|
|
for i in range(len(output_lines), len(expected_lines)):
|
2012-12-15 10:27:40 +00:00
|
|
|
print("E%i < %s" % (i + 1, expected_lines[i]))
|
2012-11-23 17:33:40 +00:00
|
|
|
for i in range(len(expected_lines), len(output_lines)):
|
2012-12-15 10:27:40 +00:00
|
|
|
print("O%i > %s" % (i + 1, output_lines[i]))
|
|
|
|
print("*** Different number of lines!")
|
2012-11-11 14:05:40 +00:00
|
|
|
different = True
|
|
|
|
|
2012-11-09 10:03:01 +00:00
|
|
|
if not different:
|
2012-11-11 21:38:19 +00:00
|
|
|
if '-v' in args:
|
2012-12-15 10:27:40 +00:00
|
|
|
print("++++++++++++++ The Equal Output +++++++++++++")
|
|
|
|
print("\n".join(output_lines))
|
|
|
|
print("+++++++++++++++++++++++++++++++++++++++++++++")
|
|
|
|
print(" " + test + " - passed!")
|
2012-11-09 10:03:01 +00:00
|
|
|
tests_passed.append(test)
|
2012-11-12 02:12:01 +00:00
|
|
|
tcprint("##teamcity[testFinished name='%s']" % test)
|
2012-11-09 09:43:11 +00:00
|
|
|
else:
|
2012-11-11 18:30:48 +00:00
|
|
|
if '-v' in args:
|
2012-12-15 10:27:40 +00:00
|
|
|
print("============== output from failed " + test + " :")
|
|
|
|
print(output)
|
|
|
|
print("============== expected output:")
|
|
|
|
print(expected_output)
|
|
|
|
print("===============================")
|
2012-11-09 10:03:01 +00:00
|
|
|
tests_failed.append(test)
|
2012-11-12 02:12:01 +00:00
|
|
|
tcprint("##teamcity[testFailed name='%s' message='Output different from expected file']" % test)
|
|
|
|
tcprint("##teamcity[testFinished name='%s']" % test)
|
2012-11-09 10:03:01 +00:00
|
|
|
|
2012-12-15 10:27:40 +00:00
|
|
|
print("%i tests passed, %i tests failed." % (
|
|
|
|
len(tests_passed), len(tests_failed)))
|
2012-11-09 12:00:36 +00:00
|
|
|
|
2012-11-09 10:03:01 +00:00
|
|
|
if len(tests_failed):
|
2012-12-15 10:27:40 +00:00
|
|
|
print("Failed tests:")
|
2012-11-09 10:03:01 +00:00
|
|
|
for t in tests_failed:
|
2012-12-15 10:27:40 +00:00
|
|
|
print(" " + t)
|
|
|
|
print("Ran " + PPSSPP_EXE)
|
2012-11-09 09:43:11 +00:00
|
|
|
|
2012-11-09 12:00:36 +00:00
|
|
|
|
2012-11-09 09:43:11 +00:00
|
|
|
def main():
|
2012-11-12 02:12:01 +00:00
|
|
|
global teamcity_mode
|
2012-11-09 09:43:11 +00:00
|
|
|
init()
|
2012-11-09 12:00:36 +00:00
|
|
|
tests = []
|
|
|
|
args = []
|
|
|
|
for arg in sys.argv[1:]:
|
2012-11-12 02:12:01 +00:00
|
|
|
if arg == '--teamcity':
|
|
|
|
teamcity_mode = True
|
|
|
|
elif arg[0] == '-':
|
2012-11-09 12:00:36 +00:00
|
|
|
args.append(arg)
|
|
|
|
else:
|
|
|
|
tests.append(arg)
|
|
|
|
|
|
|
|
if not tests:
|
2012-11-12 13:35:10 +00:00
|
|
|
if '-g' in args:
|
|
|
|
tests = tests_good
|
|
|
|
else:
|
|
|
|
tests = tests_next + tests_good
|
2012-11-09 12:00:36 +00:00
|
|
|
|
|
|
|
run_tests(tests, args)
|
2012-11-09 09:43:11 +00:00
|
|
|
|
|
|
|
main()
|