mirror of
https://github.com/catseye/SixtyPical.git
synced 2024-06-02 03:41:28 +00:00
commit
d5e6eeacd3
|
@ -1,27 +0,0 @@
|
||||||
# Python CircleCI 2.0 configuration file
|
|
||||||
#
|
|
||||||
# Check https://circleci.com/docs/2.0/language-python/ for more details
|
|
||||||
#
|
|
||||||
version: 2
|
|
||||||
jobs:
|
|
||||||
build:
|
|
||||||
docker:
|
|
||||||
- image: circleci/python:3.6.1
|
|
||||||
|
|
||||||
working_directory: ~/SixtyPical
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- checkout
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: install dependencies
|
|
||||||
command: |
|
|
||||||
echo "hi"
|
|
||||||
git clone https://github.com/catseye/Falderal
|
|
||||||
git clone https://github.com/catseye/dcc6502
|
|
||||||
(cd dcc6502 && make)
|
|
||||||
|
|
||||||
- run:
|
|
||||||
name: run tests
|
|
||||||
command: |
|
|
||||||
PATH=dcc6502:Falderal/bin:$PATH ./test.sh
|
|
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1,2 +1,3 @@
|
||||||
*.pyc
|
*.pyc
|
||||||
|
__pycache__
|
||||||
vicerc
|
vicerc
|
||||||
|
|
|
@ -1,6 +1,14 @@
|
||||||
History of SixtyPical
|
History of SixtyPical
|
||||||
=====================
|
=====================
|
||||||
|
|
||||||
|
0.21-2023.0309
|
||||||
|
--------------
|
||||||
|
|
||||||
|
* Python 3 is the default interpreter for `sixtypical`.
|
||||||
|
* Test appliance added for testing under Python 2.7.
|
||||||
|
* `dcc6502` test adapter made runnable under both
|
||||||
|
Python 2 and Python 3.
|
||||||
|
|
||||||
0.21
|
0.21
|
||||||
----
|
----
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
from os.path import realpath, dirname, join
|
from os.path import realpath, dirname, join
|
||||||
import sys
|
import sys
|
||||||
|
|
2
test.sh
2
test.sh
|
@ -2,6 +2,8 @@
|
||||||
|
|
||||||
# This currently represents a lot of tests! If you only want to run a subset,
|
# 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.
|
# 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 \
|
falderal --substring-error \
|
||||||
"tests/appliances/sixtypical.md" \
|
"tests/appliances/sixtypical.md" \
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/usr/bin/env python2
|
#!/usr/bin/env python3
|
||||||
|
|
||||||
# script that allows the binary output of sixtypical --output-format=c64-basic-prg --compile to be
|
# script that allows the binary output of sixtypical --output-format=c64-basic-prg --compile to be
|
||||||
# disassembled by https://github.com/tcarmelveilleux/dcc6502
|
# disassembled by https://github.com/tcarmelveilleux/dcc6502
|
||||||
|
@ -8,7 +8,10 @@ import re
|
||||||
from subprocess import check_output
|
from subprocess import check_output
|
||||||
from tempfile import NamedTemporaryFile
|
from tempfile import NamedTemporaryFile
|
||||||
|
|
||||||
bytes = sys.stdin.read()
|
try:
|
||||||
|
bytes = sys.stdin.buffer.read()
|
||||||
|
except AttributeError:
|
||||||
|
bytes = sys.stdin.read()
|
||||||
|
|
||||||
bytes = bytes[14:]
|
bytes = bytes[14:]
|
||||||
|
|
||||||
|
@ -17,6 +20,8 @@ filename = f.name
|
||||||
f.write(bytes)
|
f.write(bytes)
|
||||||
f.close()
|
f.close()
|
||||||
|
|
||||||
lines = [line for line in check_output("dcc6502 -o 2061 {}".format(filename), shell=True).split('\n') if line and not line.startswith(';')]
|
output = check_output("dcc6502 -o 2061 {}".format(filename), shell=True)
|
||||||
|
output_lines = output.decode('utf-8').split('\n')
|
||||||
|
lines = [line for line in output_lines if line and not line.startswith(';')]
|
||||||
lines = [re.sub(r'\s*\;.*$', '', line) for line in lines]
|
lines = [re.sub(r'\s*\;.*$', '', line) for line in lines]
|
||||||
sys.stdout.write('\n'.join(lines))
|
sys.stdout.write('\n'.join(lines))
|
||||||
|
|
30
tests/appliances/sixtypical-py2.7.md
Normal file
30
tests/appliances/sixtypical-py2.7.md
Normal file
|
@ -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 </tmp/foo"
|
||||||
|
|
||||||
|
-> 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 </tmp/foo"
|
||||||
|
|
||||||
|
-> 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 </tmp/foo"
|
Loading…
Reference in New Issue
Block a user