Added tests
This commit is contained in:
parent
0b69ea388a
commit
7e4ca53024
5
test/test_init.py
Normal file
5
test/test_init.py
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
from infernal_interpreter import __version__
|
||||||
|
|
||||||
|
|
||||||
|
def test_init():
|
||||||
|
assert __version__ is not None
|
|
@ -1,11 +1,10 @@
|
||||||
import os
|
|
||||||
import sys
|
|
||||||
import traceback
|
|
||||||
import logging
|
import logging
|
||||||
|
import traceback
|
||||||
|
|
||||||
import pytest
|
import pytest
|
||||||
|
|
||||||
|
from infernal_interpreter.Emulator import CodeParseException, Emulator
|
||||||
from infernal_interpreter.Junk import JunkComparisonException
|
from infernal_interpreter.Junk import JunkComparisonException
|
||||||
from infernal_interpreter.Emulator import Emulator, CodeParseException
|
|
||||||
|
|
||||||
logger = logging.getLogger(__name__)
|
logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -13,6 +12,7 @@ logger = logging.getLogger(__name__)
|
||||||
|
|
||||||
code_tests = []
|
code_tests = []
|
||||||
|
|
||||||
|
|
||||||
def add_test(name, result, register, code):
|
def add_test(name, result, register, code):
|
||||||
code_tests.append((name, result, register, code))
|
code_tests.append((name, result, register, code))
|
||||||
|
|
||||||
|
@ -179,7 +179,8 @@ start: movq $100, %rsp # Set stack pointer to a random position.
|
||||||
|
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
@pytest.mark.parametrize("name,result,register,code", code_tests)
|
|
||||||
|
@pytest.mark.parametrize('name,result,register,code', code_tests)
|
||||||
def test_execution(name, result, register, code):
|
def test_execution(name, result, register, code):
|
||||||
line_nr = None
|
line_nr = None
|
||||||
try:
|
try:
|
Loading…
Reference in New Issue
Block a user