diff --git a/test.sh b/test.sh index 9967a0b..03d6bae 100755 --- a/test.sh +++ b/test.sh @@ -2,6 +2,8 @@ # This currently represents a lot of tests! If you only want to run a subset, # it's probably best to run `falderal` manually on the file(s) you want to test. +# Note also that the `sixtypical-py2.7.md` appliance, in the same directory as +# `sixtypical.md`, can be used to run the tests under Python 2.7. falderal --substring-error \ "tests/appliances/sixtypical.md" \ diff --git a/tests/appliances/bin/dcc6502-adapter b/tests/appliances/bin/dcc6502-adapter index 4aff644..f1d2acd 100755 --- a/tests/appliances/bin/dcc6502-adapter +++ b/tests/appliances/bin/dcc6502-adapter @@ -8,7 +8,10 @@ import re from subprocess import check_output from tempfile import NamedTemporaryFile -bytes = sys.stdin.buffer.read() +try: + bytes = sys.stdin.buffer.read() +except AttributeError: + bytes = sys.stdin.read() bytes = bytes[14:] diff --git a/tests/appliances/sixtypical-py2.7.md b/tests/appliances/sixtypical-py2.7.md new file mode 100644 index 0000000..83f7611 --- /dev/null +++ b/tests/appliances/sixtypical-py2.7.md @@ -0,0 +1,30 @@ +This file contains only the [Falderal][] directives that define the different +functionalities tested by the test suite, assuming that it's the reference +implementation, `sixtypical`, that is going to implement these functionalities, +and additionally that `sixtypical` is running under Python 2.7. + +NOTE that this is not well-supported anymore, given that Python 2.7 is past +end-of-life. + +[Falderal]: http://catseye.tc/node/Falderal + + -> Functionality "Check syntax of SixtyPical program" is implemented by + -> shell command "python2.7 bin/sixtypical --parse-only --traceback %(test-body-file) && echo ok" + + -> Functionality "Analyze SixtyPical program" is implemented by + -> shell command "python2.7 bin/sixtypical --analyze-only --traceback %(test-body-file) && echo ok" + + -> Functionality "Compile SixtyPical program" is implemented by + -> shell command "python2.7 bin/sixtypical --output-format=c64-basic-prg --traceback %(test-body-file) --output /tmp/foo && python2.7 tests/appliances/bin/dcc6502-adapter Functionality "Dump callgraph info for SixtyPical program" is implemented by + -> shell command "python2.7 bin/sixtypical --dump-callgraph --analyze-only --traceback %(test-body-file)" + + -> Functionality "Compile SixtyPical program with unreachable routine removal" is implemented by + -> shell command "python2.7 bin/sixtypical --output-format=c64-basic-prg --prune-unreachable-routines --traceback %(test-body-file) --output /tmp/foo && python2.7 tests/appliances/bin/dcc6502-adapter Functionality "Dump fallthru info for SixtyPical program" is implemented by + -> shell command "python2.7 bin/sixtypical --optimize-fallthru --dump-fallthru-info --analyze-only --traceback %(test-body-file)" + + -> Functionality "Compile SixtyPical program with fallthru optimization" is implemented by + -> shell command "python2.7 bin/sixtypical --output-format=c64-basic-prg --optimize-fallthru --traceback %(test-body-file) --output /tmp/foo && python2.7 tests/appliances/bin/dcc6502-adapter