#!/usr/local/bin/python3.6
# (c) 2019 Aaron Taylor <ataylor at subgeniuskitty dot com>
# Quick and dirty tests for the VVhitespace stdlib.
include_path
= '-I../stdlib'
cpp_temp_file
= 'test.pvvs'
interpreter_path
= '../vvi'
# Format: ['filename_without_extension', 'string for stdin', 'string for expected stdout']
['0001_dumpstack', '', 'TOS:\n1:\t+42\n0:\t+255\n'],
['0002_dumpheap', '', '32:\t+255\n33:\t+42\n'],
subprocess
.run([preprocessor
, include_path
, "-o", cpp_temp_file
, path_to_tests
+ test
[0] + src_extension
])
subprocess
.run([compiler_path
, '-i', cpp_temp_file
, '-o', temp_file
])
result
= subprocess
.run([interpreter_path
, '-i', temp_file
], stdout
=subprocess
.PIPE
, input=test
[1].encode('utf-8'))
if result
.stdout
.decode('utf-8') != test
[2]:
print('.', end
='', flush
=True)