Merge pull request #23 from catseye/develop-2023-1
Develop 2023 1
Chris Pressey authored 6 months ago
GitHub committed 6 months ago
0 | # Python CircleCI 2.0 configuration file | |
1 | # | |
2 | # Check https://circleci.com/docs/2.0/language-python/ for more details | |
3 | # | |
4 | version: 2 | |
5 | jobs: | |
6 | build: | |
7 | docker: | |
8 | - image: circleci/python:3.6.1 | |
9 | ||
10 | working_directory: ~/SixtyPical | |
11 | ||
12 | steps: | |
13 | - checkout | |
14 | ||
15 | - run: | |
16 | name: install dependencies | |
17 | command: | | |
18 | echo "hi" | |
19 | git clone https://github.com/catseye/Falderal | |
20 | git clone https://github.com/catseye/dcc6502 | |
21 | (cd dcc6502 && make) | |
22 | ||
23 | - run: | |
24 | name: run tests | |
25 | command: | | |
26 | PATH=dcc6502:Falderal/bin:$PATH ./test.sh |
0 | 0 | History of SixtyPical |
1 | 1 | ===================== |
2 | ||
3 | 0.21-2023.0309 | |
4 | -------------- | |
5 | ||
6 | * Python 3 is the default interpreter for `sixtypical`. | |
7 | * Test appliance added for testing under Python 2.7. | |
8 | * `dcc6502` test adapter made runnable under both | |
9 | Python 2 and Python 3. | |
2 | 10 | |
3 | 11 | 0.21 |
4 | 12 | ---- |
0 | #!/usr/bin/env python | |
0 | #!/usr/bin/env python3 | |
1 | 1 | |
2 | 2 | from os.path import realpath, dirname, join |
3 | 3 | import sys |
1 | 1 | |
2 | 2 | # This currently represents a lot of tests! If you only want to run a subset, |
3 | 3 | # it's probably best to run `falderal` manually on the file(s) you want to test. |
4 | # Note also that the `sixtypical-py2.7.md` appliance, in the same directory as | |
5 | # `sixtypical.md`, can be used to run the tests under Python 2.7. | |
4 | 6 | |
5 | 7 | falderal --substring-error \ |
6 | 8 | "tests/appliances/sixtypical.md" \ |
0 | #!/usr/bin/env python2 | |
0 | #!/usr/bin/env python3 | |
1 | 1 | |
2 | 2 | # script that allows the binary output of sixtypical --output-format=c64-basic-prg --compile to be |
3 | 3 | # disassembled by https://github.com/tcarmelveilleux/dcc6502 |
7 | 7 | from subprocess import check_output |
8 | 8 | from tempfile import NamedTemporaryFile |
9 | 9 | |
10 | bytes = sys.stdin.read() | |
10 | try: | |
11 | bytes = sys.stdin.buffer.read() | |
12 | except AttributeError: | |
13 | bytes = sys.stdin.read() | |
11 | 14 | |
12 | 15 | bytes = bytes[14:] |
13 | 16 | |
16 | 19 | f.write(bytes) |
17 | 20 | f.close() |
18 | 21 | |
19 | lines = [line for line in check_output("dcc6502 -o 2061 {}".format(filename), shell=True).split('\n') if line and not line.startswith(';')] | |
22 | output = check_output("dcc6502 -o 2061 {}".format(filename), shell=True) | |
23 | output_lines = output.decode('utf-8').split('\n') | |
24 | lines = [line for line in output_lines if line and not line.startswith(';')] | |
20 | 25 | lines = [re.sub(r'\s*\;.*$', '', line) for line in lines] |
21 | 26 | sys.stdout.write('\n'.join(lines)) |
0 | This file contains only the [Falderal][] directives that define the different | |
1 | functionalities tested by the test suite, assuming that it's the reference | |
2 | implementation, `sixtypical`, that is going to implement these functionalities, | |
3 | and additionally that `sixtypical` is running under Python 2.7. | |
4 | ||
5 | NOTE that this is not well-supported anymore, given that Python 2.7 is past | |
6 | end-of-life. | |
7 | ||
8 | [Falderal]: http://catseye.tc/node/Falderal | |
9 | ||
10 | -> Functionality "Check syntax of SixtyPical program" is implemented by | |
11 | -> shell command "python2.7 bin/sixtypical --parse-only --traceback %(test-body-file) && echo ok" | |
12 | ||
13 | -> Functionality "Analyze SixtyPical program" is implemented by | |
14 | -> shell command "python2.7 bin/sixtypical --analyze-only --traceback %(test-body-file) && echo ok" | |
15 | ||
16 | -> Functionality "Compile SixtyPical program" is implemented by | |
17 | -> 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" | |
18 | ||
19 | -> Functionality "Dump callgraph info for SixtyPical program" is implemented by | |
20 | -> shell command "python2.7 bin/sixtypical --dump-callgraph --analyze-only --traceback %(test-body-file)" | |
21 | ||
22 | -> Functionality "Compile SixtyPical program with unreachable routine removal" is implemented by | |
23 | -> 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" | |
24 | ||
25 | -> Functionality "Dump fallthru info for SixtyPical program" is implemented by | |
26 | -> shell command "python2.7 bin/sixtypical --optimize-fallthru --dump-fallthru-info --analyze-only --traceback %(test-body-file)" | |
27 | ||
28 | -> Functionality "Compile SixtyPical program with fallthru optimization" is implemented by | |
29 | -> 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" |