aboutsummaryrefslogtreecommitdiff
path: root/tests/tcctest.py
diff options
context:
space:
mode:
authorJames Lyon <jamesly0n@hotmail.com>2013-04-25 01:08:18 +0100
committerJames Lyon <jamesly0n@hotmail.com>2013-04-25 01:08:18 +0100
commite7a7efed11792e0dbc14a66b02fa7b25886f69d8 (patch)
treea8ac98cdc31dc8f15cff22b46b2a9799183bd8e5 /tests/tcctest.py
parent5c35ba66c5ade4713bbd9c005e66889f6d7db293 (diff)
downloadtinycc-e7a7efed11792e0dbc14a66b02fa7b25886f69d8.tar.gz
tinycc-e7a7efed11792e0dbc14a66b02fa7b25886f69d8.tar.bz2
Added cross compilation to CMake build system.
Brings it more into line with make based system. I've tested on 32- and 64-bit Windows, but not yet Linux.
Diffstat (limited to 'tests/tcctest.py')
-rw-r--r--tests/tcctest.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/tests/tcctest.py b/tests/tcctest.py
new file mode 100644
index 0000000..817250f
--- /dev/null
+++ b/tests/tcctest.py
@@ -0,0 +1,15 @@
+import subprocess
+import sys
+import difflib
+
+def main():
+ reference = subprocess.check_output([sys.argv[1]])
+ compare = subprocess.check_output(sys.argv[2:])
+ failed = False
+ for line in difflib.unified_diff(reference.split('\n'), compare.split('\n'), fromfile='cc', tofile='tcc', lineterm=''):
+ failed = True
+ print line
+ sys.exit(1 if failed else 0)
+
+if __name__ == '__main__':
+ main()