Skip to content

Modify test framework to derive everything from compiler object #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions run-some-tests.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/usr/bin/env python3
import os
import sys
import getopt

from utils import run_selected_tests, enable_tracing, enable_emulation

import var

sys.setrecursionlimit(10000)

try:
opts, files = getopt.getopt(sys.argv[1:],"te")
except getopt.GetoptError:
print ('usage: run-tests.py [-t] [-e]')
sys.exit(1)

for opt,arg in opts:
if opt == '-t':
enable_tracing()
if opt == '-e':
enable_emulation()

run_selected_tests(files, compiler.Compiler())

28 changes: 2 additions & 26 deletions run-tests.py
Original file line number Diff line number Diff line change
@@ -1,35 +1,11 @@
import os
import compiler
import interp_Lvar
import type_check_Lvar
from utils import run_tests, run_one_test
from interp_x86.eval_x86 import interp_x86

compiler = compiler.Compiler()

typecheck_Lvar = type_check_Lvar.TypeCheckLvar().type_check

typecheck_dict = {
'source': typecheck_Lvar,
'remove_complex_operands': typecheck_Lvar,
}
interpLvar = interp_Lvar.InterpLvar().interp
interp_dict = {
'remove_complex_operands': interpLvar,
'select_instructions': interp_x86,
'assign_homes': interp_x86,
'patch_instructions': interp_x86,
}

if False:
run_one_test(os.getcwd() + '/tests/var/zero.py',
'var',
compiler,
'var',
typecheck_dict,
interp_dict)
compiler)
else:
run_tests('var', compiler, 'var',
typecheck_dict,
interp_dict)

run_tests('var', compiler)
Loading