2018-09-28 17:05:11 +00:00
|
|
|
# SourceGen Test Data #
|
|
|
|
|
|
|
|
This directory contains various regression tests.
|
|
|
|
|
|
|
|
NOTE: some tests may fail if you use a version of the assembler that is
|
|
|
|
different from the one used to generate the expected output. The current
|
2019-08-11 18:27:09 +00:00
|
|
|
set was generated for:
|
2018-09-28 17:05:11 +00:00
|
|
|
|
2019-04-18 17:41:01 +00:00
|
|
|
* 64tass v1.53.1515
|
2019-08-11 18:27:09 +00:00
|
|
|
* ACME v0.96.4
|
|
|
|
* cc65 v2.18
|
2018-09-28 17:05:11 +00:00
|
|
|
* Merlin 32 v1.0
|
|
|
|
|
|
|
|
|
|
|
|
## Generator/Assembler Tests ##
|
|
|
|
|
Regression test rework, part 1
The regression tests were written with the assumption that all cross
assemblers would support 6502, 65C02, and 65816 code. There are a
few that support 65816 partially (e.g. ACME) or not at all. To best
support these, we need to split some of the tests into pieces, so
that important 6502 tests aren't skipped simply because parts of the
test also exercise 65816 code.
The first step is to change the regression test naming scheme. The
old system used 1xxx for tests without project files, and 2xxx for
tests with project files. The new system uses 1xxxN / 2xxxN, where
N indicates the CPU type: 0 for 6502, 1 for 65C02, and 2 for 65816.
For the 1xxxN tests the new value determines which CPU is used,
which allows us to move the "allops" 6502/65C02 tests into the
no-project category. For 2xxxN it just allows the 6502 and 65816
versions to have the same base name and number.
This change updates the first batch of tests. It involves minor
changes to the test harness and a whole bunch of renaming.
2020-06-06 21:22:53 +00:00
|
|
|
Files with names like "10000-nifty-test" are regression test data files
|
2018-09-28 17:05:11 +00:00
|
|
|
for the code generator. The test harness identifies them by filename
|
Regression test rework, part 1
The regression tests were written with the assumption that all cross
assemblers would support 6502, 65C02, and 65816 code. There are a
few that support 65816 partially (e.g. ACME) or not at all. To best
support these, we need to split some of the tests into pieces, so
that important 6502 tests aren't skipped simply because parts of the
test also exercise 65816 code.
The first step is to change the regression test naming scheme. The
old system used 1xxx for tests without project files, and 2xxx for
tests with project files. The new system uses 1xxxN / 2xxxN, where
N indicates the CPU type: 0 for 6502, 1 for 65C02, and 2 for 65816.
For the 1xxxN tests the new value determines which CPU is used,
which allows us to move the "allops" 6502/65C02 tests into the
no-project category. For 2xxxN it just allows the 6502 and 65816
versions to have the same base name and number.
This change updates the first batch of tests. It involves minor
changes to the test harness and a whole bunch of renaming.
2020-06-06 21:22:53 +00:00
|
|
|
pattern: five digits, a hyphen, then one or more alphanumeric and
|
2018-09-28 17:05:11 +00:00
|
|
|
hyphens. Files with a '.' or '_' are ignored.
|
|
|
|
|
Regression test rework, part 1
The regression tests were written with the assumption that all cross
assemblers would support 6502, 65C02, and 65816 code. There are a
few that support 65816 partially (e.g. ACME) or not at all. To best
support these, we need to split some of the tests into pieces, so
that important 6502 tests aren't skipped simply because parts of the
test also exercise 65816 code.
The first step is to change the regression test naming scheme. The
old system used 1xxx for tests without project files, and 2xxx for
tests with project files. The new system uses 1xxxN / 2xxxN, where
N indicates the CPU type: 0 for 6502, 1 for 65C02, and 2 for 65816.
For the 1xxxN tests the new value determines which CPU is used,
which allows us to move the "allops" 6502/65C02 tests into the
no-project category. For 2xxxN it just allows the 6502 and 65816
versions to have the same base name and number.
This change updates the first batch of tests. It involves minor
changes to the test harness and a whole bunch of renaming.
2020-06-06 21:22:53 +00:00
|
|
|
If the leading number is between 10000 and 19999, inclusive, the test file
|
|
|
|
will be loaded as a new project. A load address of $1000 is assumed.
|
|
|
|
The CPU type is determined by the last digit: 0 for 6502, 1 for 65C02,
|
2020-10-11 21:35:17 +00:00
|
|
|
2 for 65816, and 3 for W65C02. Undocumented opcodes are enabled. As with
|
2020-10-23 17:50:36 +00:00
|
|
|
all new projects, the first byte will be tagged as a code start point. The
|
2020-10-11 21:35:17 +00:00
|
|
|
entry flags are currently set to emulation mode, but tests should not rely
|
|
|
|
on that.
|
2018-09-28 17:05:11 +00:00
|
|
|
|
Regression test rework, part 1
The regression tests were written with the assumption that all cross
assemblers would support 6502, 65C02, and 65816 code. There are a
few that support 65816 partially (e.g. ACME) or not at all. To best
support these, we need to split some of the tests into pieces, so
that important 6502 tests aren't skipped simply because parts of the
test also exercise 65816 code.
The first step is to change the regression test naming scheme. The
old system used 1xxx for tests without project files, and 2xxx for
tests with project files. The new system uses 1xxxN / 2xxxN, where
N indicates the CPU type: 0 for 6502, 1 for 65C02, and 2 for 65816.
For the 1xxxN tests the new value determines which CPU is used,
which allows us to move the "allops" 6502/65C02 tests into the
no-project category. For 2xxxN it just allows the 6502 and 65816
versions to have the same base name and number.
This change updates the first batch of tests. It involves minor
changes to the test harness and a whole bunch of renaming.
2020-06-06 21:22:53 +00:00
|
|
|
If the leading number is 20000 or greater, the test file will be loaded as
|
2018-09-28 17:05:11 +00:00
|
|
|
a saved project. A file with the same name plus a ".dis65" extension will
|
|
|
|
be opened as the project file.
|
|
|
|
|
|
|
|
### Execution ###
|
|
|
|
|
|
|
|
With debug features enabled, you can open the test runner from the menu
|
|
|
|
with Debug > Source Generation Tests. Click "Run Test" to run all tests.
|
|
|
|
|
|
|
|
For each test, the test harness will create a new project or open the
|
|
|
|
project file. For every known assembler, the test harness will generate
|
|
|
|
source code, and compare it to the corresponding entry in the Expected
|
|
|
|
directory. If they don't match exactly, a failure is reported for the
|
|
|
|
generation phase. (These are text files, so the line terminators are not
|
|
|
|
required to match.) Next, the generated sources are fed to the appropriate
|
|
|
|
cross-assembler, whether or not the sources matched expectations. If the
|
|
|
|
assembler reports success, the output file is compared to the original data
|
|
|
|
file. If these match, success is reported for the assembly phase.
|
|
|
|
|
|
|
|
The top window in the test harness shows a summary of success or failure.
|
|
|
|
The bottom window shows details reported for each individual test. Use
|
|
|
|
the drop list to select which test is shown.
|
|
|
|
|
|
|
|
The generated sources and assembled output is placed into a temporary
|
|
|
|
directory inside SGTestData that is named after the test. For example,
|
Regression test rework, part 1
The regression tests were written with the assumption that all cross
assemblers would support 6502, 65C02, and 65816 code. There are a
few that support 65816 partially (e.g. ACME) or not at all. To best
support these, we need to split some of the tests into pieces, so
that important 6502 tests aren't skipped simply because parts of the
test also exercise 65816 code.
The first step is to change the regression test naming scheme. The
old system used 1xxx for tests without project files, and 2xxx for
tests with project files. The new system uses 1xxxN / 2xxxN, where
N indicates the CPU type: 0 for 6502, 1 for 65C02, and 2 for 65816.
For the 1xxxN tests the new value determines which CPU is used,
which allows us to move the "allops" 6502/65C02 tests into the
no-project category. For 2xxxN it just allows the 6502 and 65816
versions to have the same base name and number.
This change updates the first batch of tests. It involves minor
changes to the test harness and a whole bunch of renaming.
2020-06-06 21:22:53 +00:00
|
|
|
test 10000-allops-value-6502 will have all of its generated output in a
|
|
|
|
directory called "tmp10000". If all parts of the test are successful, the
|
2018-09-28 17:05:11 +00:00
|
|
|
directory will be removed. If generation or assembly fails, or if you check
|
|
|
|
the "retain output" box in the test harness, the directory and its contents
|
|
|
|
will remain. This allows you to examine the outputs when investigating
|
|
|
|
failures.
|
|
|
|
|
|
|
|
As a safety measure, the directory will NOT be removed if it contains files
|
|
|
|
that the test harness doesn't recognize.
|
|
|
|
|
|
|
|
### Updating Tests ###
|
|
|
|
|
|
|
|
If you want to add or update a test, follow these steps:
|
|
|
|
|
|
|
|
1. Make the changes to the test data file and test project file.
|
|
|
|
2. Run the test harness. The generation test will fail and leave output in
|
Regression test rework, part 1
The regression tests were written with the assumption that all cross
assemblers would support 6502, 65C02, and 65816 code. There are a
few that support 65816 partially (e.g. ACME) or not at all. To best
support these, we need to split some of the tests into pieces, so
that important 6502 tests aren't skipped simply because parts of the
test also exercise 65816 code.
The first step is to change the regression test naming scheme. The
old system used 1xxx for tests without project files, and 2xxx for
tests with project files. The new system uses 1xxxN / 2xxxN, where
N indicates the CPU type: 0 for 6502, 1 for 65C02, and 2 for 65816.
For the 1xxxN tests the new value determines which CPU is used,
which allows us to move the "allops" 6502/65C02 tests into the
no-project category. For 2xxxN it just allows the 6502 and 65816
versions to have the same base name and number.
This change updates the first batch of tests. It involves minor
changes to the test harness and a whole bunch of renaming.
2020-06-06 21:22:53 +00:00
|
|
|
the tmpNNNNN directory. Make sure the assembly test is succeeding.
|
2018-09-28 17:05:11 +00:00
|
|
|
3. After verifying that the generated sources look correct, copy them
|
|
|
|
into the Expected directory, replacing any existing copies.
|
|
|
|
4. Run the test harness. This should now report success, and will
|
Regression test rework, part 1
The regression tests were written with the assumption that all cross
assemblers would support 6502, 65C02, and 65816 code. There are a
few that support 65816 partially (e.g. ACME) or not at all. To best
support these, we need to split some of the tests into pieces, so
that important 6502 tests aren't skipped simply because parts of the
test also exercise 65816 code.
The first step is to change the regression test naming scheme. The
old system used 1xxx for tests without project files, and 2xxx for
tests with project files. The new system uses 1xxxN / 2xxxN, where
N indicates the CPU type: 0 for 6502, 1 for 65C02, and 2 for 65816.
For the 1xxxN tests the new value determines which CPU is used,
which allows us to move the "allops" 6502/65C02 tests into the
no-project category. For 2xxxN it just allows the 6502 and 65816
versions to have the same base name and number.
This change updates the first batch of tests. It involves minor
changes to the test harness and a whole bunch of renaming.
2020-06-06 21:22:53 +00:00
|
|
|
remove the tmpNNNNN directory.
|
2018-09-28 17:05:11 +00:00
|
|
|
|
|
|
|
Be sure to have the version of the cross-assembler identified at the top
|
|
|
|
of this document configured.
|
|
|
|
|
|
|
|
|
|
|
|
### Other Notes ###
|
|
|
|
|
|
|
|
The original source code used to generate the test cases can be found
|
|
|
|
in the Source directory. The test harness does not use these files. If
|
|
|
|
you want to update a test file, you will need to run the assembler
|
|
|
|
yourself. The assembler used is noted in a comment at the top of the file.
|
|
|
|
|
|
|
|
The code is not required to do anything useful. Many of the test cases
|
|
|
|
would crash or hang if executed.
|
|
|
|
|
|
|
|
|
|
|
|
## FunkyProjects ##
|
|
|
|
|
|
|
|
This is a collection of project files with deliberate errors. These exist
|
|
|
|
to exercise the load-time error reporting. See the README in that directory
|
|
|
|
for a full explanation.
|
|
|
|
|
2019-12-04 23:50:19 +00:00
|
|
|
|
|
|
|
## Visualization ##
|
|
|
|
|
|
|
|
Some test projects and data files for exercising the visualization generators.
|
|
|
|
Not part of a formal test; load the projects and eyeball the results.
|
|
|
|
|