# Path: tests/klltest.py
# def kll_run(args):
#     '''
#     Run kll compiler
# 
#     @return: Exit code
#     '''
#     with pytest.raises(SystemExit) as pytest_wrapped_e:
#         kll.main(args)
#     assert pytest_wrapped_e.type == SystemExit
#     return pytest_wrapped_e.value.code
# 
# def header_test(name, args):
#     '''
#     Prints out the name of the test and the arguments passed
# 
#     @param name: Name of the test
#     @param args: List of arguments
#     '''
#     print('\n---- {} ---- {}'.format(name, args))


import pytest
from tests.klltest import kll_run, header_test
    'kll/examples/assignment.kll',
    'kll/examples/capabilitiesExample.kll',
    'kll/examples/colemak.kll',
    'kll/examples/defaultMapExample.kll',
    'kll/examples/example.kll',
    'kll/examples/hhkbpro2.kll',
    'kll/examples/leds.kll',
    'kll/examples/mapping.kll',
    'kll/examples/md1Map.kll',
    'kll/examples/simple1.kll',
    'kll/examples/simple2.kll',
    'kll/examples/simpleExample.kll',
    'kll/examples/state_scheduling.kll',
    'kll/layouts/mouseTest.kll',
    'kll/layouts/klltest.kll',
    'kll/layouts/klltest_default.kll',
    'kll/examples/triggers.kll',
    'kll/examples/utf8.kll',
]



### Tests ###

@pytest.mark.parametrize('input_file', test_files)
def test_syntax(input_file):
    '''
    Runs syntax test on each of the specified files
    '''
    args = ['--emitter', 'none', '--data-finalization-display', input_file]

# Path: tests/klltest.py
# def kll_run(args):
#     '''
#     Run kll compiler
# 
#     @return: Exit code
#     '''
#     with pytest.raises(SystemExit) as pytest_wrapped_e:
#         kll.main(args)
#     assert pytest_wrapped_e.type == SystemExit
#     return pytest_wrapped_e.value.code
# 
# def header_test(name, args):
#     '''
#     Prints out the name of the test and the arguments passed
# 
#     @param name: Name of the test
#     @param args: List of arguments
#     '''
#     print('\n---- {} ---- {}'.format(name, args))


# Path: tests/test_syntax.py
import pytest
from tests.klltest import kll_run, header_test

    'kll/examples/assignment.kll',
    'kll/examples/capabilitiesExample.kll',
    'kll/examples/colemak.kll',
    'kll/examples/defaultMapExample.kll',
    'kll/examples/example.kll',
    'kll/examples/hhkbpro2.kll',
    'kll/examples/leds.kll',
    'kll/examples/mapping.kll',
    'kll/examples/md1Map.kll',
    'kll/examples/simple1.kll',
    'kll/examples/simple2.kll',
    'kll/examples/simpleExample.kll',
    'kll/examples/state_scheduling.kll',
    'kll/layouts/mouseTest.kll',
    'kll/layouts/klltest.kll',
    'kll/layouts/klltest_default.kll',
    'kll/examples/triggers.kll',
    'kll/examples/utf8.kll',
]



### Tests ###

@pytest.mark.parametrize('input_file', test_files)
def test_syntax(input_file):
    '''
    Runs syntax test on each of the specified files
    '''
    args = ['--emitter', 'none', '--data-finalization-display', input_file]

    header_test(input_file, args)