mirror of
https://github.com/alliedmodders/sourcemod.git
synced 2025-12-07 02:18:35 +00:00
commit1e5213d43fAuthor: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 04:09:27 2014 -0700 Quell MSVC C99 bugs. commitf2e166c592Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:59:23 2014 -0700 Fix varying levels of stupid memory errors. commitb0773d7be4Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:36:39 2014 -0700 Fix memory leak in parsing some control flow structures. commit5aca55713cAuthor: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:35:17 2014 -0700 Fix memory leak in struct parsing. commitb46ec5cd28Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 03:32:03 2014 -0700 Fix build. commit17bbbb9a46Merge:c0834092107599Author: David Anderson <dvander@alliedmods.net> Date: Sat Jun 21 01:26:27 2014 -0700 Merge branch 'master' into methodmaps commitc083409b56Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 23:49:36 2014 -0700 Add VS2k13 support. commitb799377849Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 01:28:08 2014 -0700 Implement destructors. commit1a340dec26Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 00:08:04 2014 -0700 Add some tests. commit12db52ee64Author: David Anderson <dvander@alliedmods.net> Date: Fri Jun 20 00:05:49 2014 -0700 Initial implementation of constructors. commit074669a658Author: David Anderson <dvander@alliedmods.net> Date: Thu Jun 19 22:42:35 2014 -0700 Add simple test harness. commit27c1e3cf14Author: David Anderson <dvander@alliedmods.net> Date: Thu Jun 19 22:15:42 2014 -0700 Big refactoring for new syntax. commitf3c37fdc91Author: David Anderson <dvander@alliedmods.net> Date: Thu Jun 19 22:12:54 2014 -0700 Refactor tests for the new syntax. commit6211f392f8Author: David Anderson <dvander@alliedmods.net> Date: Wed Jun 18 22:25:48 2014 -0700 Make lexer tokens an enum. commit5210b01375Author: David Anderson <dvander@alliedmods.net> Date: Tue Jun 17 06:48:15 2014 -0700 Add comment. commit06688ff4acAuthor: David Anderson <dvander@alliedmods.net> Date: Tue Jun 17 06:46:10 2014 -0700 Allow |this| to be a base type of the methodmap. commit05cf368202Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 22:11:58 2014 -0700 Unify duplicate typesymbol checking. commit09161bf269Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 19:53:36 2014 -0700 Close loophole that allowed methodmaps for enums. commit5bb4aeba89Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:50:42 2014 -0700 Add tests and dbi/handle changes. commitb9203e2491Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:38:29 2014 -0700 Ensure methodmap tags are fixed. commit878b80fd87Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:36:04 2014 -0700 Implement inheritance. commit6ba9e004fbAuthor: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:31:00 2014 -0700 Refactor matchtag() to not be insane. commit4ede6343b0Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:20:50 2014 -0700 Fix indenting. commite3ddef8916Author: David Anderson <dvander@alliedmods.net> Date: Mon Jun 16 01:20:27 2014 -0700 Initial prototype.
75 lines
2.2 KiB
Python
75 lines
2.2 KiB
Python
# vim: set ts=4 sw=4 tw=99 et:
|
|
import os, sys
|
|
import argparse
|
|
import subprocess
|
|
|
|
def run_tests(args):
|
|
testdir = os.path.dirname(os.path.abspath(__file__))
|
|
tests = []
|
|
for filename in os.listdir(testdir):
|
|
base, ext = os.path.splitext(filename)
|
|
if ext == '.sp':
|
|
tests += [base]
|
|
|
|
failed = False
|
|
|
|
for test in tests:
|
|
print('Testing {0}...'.format(test))
|
|
if test.startswith('fail-'):
|
|
kind = 'fail'
|
|
elif test.startswith('warn-'):
|
|
kind = 'warn'
|
|
elif test.startswith('ok-'):
|
|
kind = 'pass'
|
|
|
|
try:
|
|
argv = [args.spcomp, os.path.join(testdir, test + '.sp')]
|
|
p = subprocess.Popen(argv, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
|
stdout, stderr = p.communicate()
|
|
stdout = stdout.decode('utf-8')
|
|
stderr = stderr.decode('utf-8')
|
|
|
|
smx_path = test + '.smx'
|
|
compiled = os.path.exists(smx_path)
|
|
if compiled:
|
|
os.unlink(smx_path)
|
|
|
|
status = 'ok'
|
|
if compiled and kind == 'fail':
|
|
status = 'fail'
|
|
elif not compiled and kind != 'fail':
|
|
status = 'fail'
|
|
|
|
if status == 'ok' and kind != 'pass':
|
|
with open(os.path.join(testdir, test + '.txt')) as fp:
|
|
text = fp.read()
|
|
if text not in stdout:
|
|
print('Expected to find text in stdout: >>>')
|
|
print(text)
|
|
print('<<<')
|
|
status = 'fail'
|
|
|
|
if status == 'fail':
|
|
failed = True
|
|
print('FAILED! Dumping stdout/stderr:')
|
|
print(stdout)
|
|
print(stderr)
|
|
else:
|
|
print('... OK!')
|
|
|
|
except Exception as exn:
|
|
raise
|
|
sys.stderr.write('FAILED! {0}\n'.format(exn.message))
|
|
|
|
if failed:
|
|
sys.exit(1)
|
|
|
|
def main():
|
|
parser = argparse.ArgumentParser()
|
|
parser.add_argument('spcomp', type=str, help='Path to spcomp')
|
|
args = parser.parse_args()
|
|
run_tests(args)
|
|
|
|
if __name__ == '__main__':
|
|
main()
|