X-Git-Url: http://git.subgeniuskitty.com/vvhitespace/.git/blobdiff_plain/9686c90139fc19b70f42283b1504ab9d5be7932c..6e942bd8524e9393f61a0358a0282b2641f9d3d7:/vv_test.py diff --git a/vv_test.py b/vv_test.py new file mode 100755 index 0000000..46f5bc9 --- /dev/null +++ b/vv_test.py @@ -0,0 +1,30 @@ +#!/usr/local/bin/python3.6 + +# (c) 2019 Aaron Taylor +# All rights reserved. + +# Quick and dirty tests for the VVhitespace interpreter. + +import os, subprocess + +compiler_path = './vvc' +interpreter_path = './vvi' +temp_file = './test.vvs' +path_to_tests = './tests/' +src_extension = '.pvvs' + +tests = [ + ['0001_push_printchar_exit', 'A'], + ['1001_stack_operations', 'BB'] + ] + +for test in tests: + subprocess.run([compiler_path, '-i', path_to_tests + test[0] + src_extension, '-o', temp_file]) + result = subprocess.run([interpreter_path, '-i', temp_file], stdout=subprocess.PIPE) + if result.stdout.decode('utf-8') != test[1]: + print(test[0]) + else: + print('.', end='') + os.remove(temp_file) + +print("")