Commit Graph

146 Commits

Author SHA1 Message Date
ISSOtm
b0ec8468e6 Allow specifying offset in addition to alignment 2020-04-08 00:40:41 +02:00
ISSOtm
190678107b Prevent RGBLINK from crashing when getting the bank of a constant 2020-04-07 20:41:29 +02:00
ISSOtm
82e0e4ffaf Make some RGBLINK errors non-fatal 2020-04-06 00:48:10 +02:00
ISSOtm
ffb199a26a Avoid Useless Use of backticks in rgblink testing 2020-04-06 00:44:59 +02:00
ISSOtm
175933d2b1 Remove old scripts for updating references for tests
I much rather prefer correcting everything by hand, and gauging
whether the change is good on a case by case basis
2020-04-06 00:41:37 +02:00
ISSOtm
92134d7684 Add testing for assertions inside unionized sections 2020-03-22 11:14:04 +01:00
ISSOtm
4877bb783c Add more tests for unionized sections + fix bugs
Implementing those tests found a few bugs... oops
2020-03-22 11:14:04 +01:00
ISSOtm
e123b6dec7 Implement unionized sections in RGBLINK 2020-03-22 11:13:39 +01:00
ISSOtm
fb58166e5d Add assertions
Closes #292
2020-03-21 23:00:38 +01:00
ISSOtm
eb445271df Remove carryover from RGBASM in RGBLINK tests 2020-03-20 21:50:38 +01:00
ISSOtm
8c4b473d6f Add more checks to section creation in RGBASM
Fixes rednex#471, but also backports a couple more checks from RGBLINK
2020-02-10 03:35:55 +01:00
ISSOtm
b42a04c24e Add test for jr @
Fun fact: current build *fails* this test!
2020-02-07 13:19:50 +01:00
ISSOtm
9687e6e1dd Allow forcing the second byte of STOP
Fixes #433
2020-02-07 10:06:02 +01:00
ISSOtm
ee34200e5f Output diffs when binary tests fail 2020-02-06 15:36:15 +01:00
ISSOtm
295fc6c619 Improve coverage of db-@ test 2020-02-05 13:24:50 +01:00
ISSOtm
35f7340dc9 Report failing test names in RGBLINK as well 2020-02-04 01:41:35 +01:00
ISSOtm
b1cd730db2 Add link-time RST instruction
This allows using a label as the argument to a `rst` instruction
Fixes rednex#448
2020-02-03 21:07:12 +01:00
ISSOtm
ed06981f57 Add test for db X, @
It should behave identically to both of these on separate lines
2020-01-28 21:04:41 +01:00
ISSOtm
1bd41bf79a Don't use diff to compare bin files in tests 2020-01-26 21:10:31 +01:00
Eldred Habert
fb81733b2b Merge pull request #472 from ISSOtm/romx-tiny
Allow ROMX and WRAMX sections in restricted modes
2020-01-26 14:48:32 +01:00
ISSOtm
1f8422575e Test that all-instructions does not error out 2020-01-21 03:05:22 +01:00
ISSOtm
61c381a62c Systemize RGBLINK testing 2020-01-21 03:01:58 +01:00
ISSOtm
71fe652556 Allow ROMX and WRAMX sections in restricted modes
Closes #462, although with this implementation `BANK("some ROMX section")` would
return 0 instead of 1, which I think is benign anyways
2020-01-16 22:24:05 +01:00
ISSOtm
2c52364978 Add test for fixed section addresses 2020-01-16 18:12:42 +01:00
ISSOtm
10140f74dc Allow RGBLINK to report multiple sanity check errors 2020-01-16 18:10:35 +01:00
ISSOtm
8a90d74340 Ignore line endings in test suite
This removes many false positives with Windows
2020-01-09 01:10:51 +01:00
Eldred Habert
c568b3a976 Merge pull request #439 from ISSOtm/tests_locale
Run tests under a specific locale
2019-11-03 16:30:38 +01:00
ISSOtm
0e24adcafd Rewrite RGBLINK entirely
The goal was to improve readability, but along the way a few things were
gained.
- Sorted sym and map files
- Infrastructure for supporting multiple .o versions
- Valgrind-proof, as far as my testing goes anyways
- Improved verbosity messages
- Added error checking
- Performance improvements, see end of commit message

The readability improvement was spurred while trying to make sense of the
old code while trying to implement features such as sorted sym and map
files.
I also did my best to remove hardcoded logic, such that modifications
should be doable; for example, "RAM loading" sections, which are linked
against a different location than the one they're stored at.

Some work remains to be done, see the "TODO:" and "FIXME:" comments.
Further, while regression tests pass, this new linker should be tested on
different codebases (ideally while instrumented with `make develop` and
under valgrind).
The few errors spotted in the man pages (alignment) need to be corrected.
Finally, documentation comments need to be written, I have written a lot of
them but not all.

This also provides a significant performance boost (benchmarked with a
51994-symbol project):

Current master RGBLINK:
2.02user 0.03system 0:02.06elapsed 99%CPU (0avgtext+0avgdata 84336maxresident)k
0inputs+11584outputs (0major+20729minor)pagefaults 0swaps

Rewritten RGBLINK:
0.19user 0.06system 0:00.63elapsed 40%CPU (0avgtext+0avgdata 32460maxresident)k
23784inputs+11576outputs (0major+7672minor)pagefaults 0swaps
2019-11-02 22:37:10 +01:00
ISSOtm
d76f994318 Run tests under a specific locale
Fixes #427
2019-10-10 13:23:36 +02:00
ISSOtm
dab5f59ed9 Fix location of all relevant SECTIONs in tests
If section placement is changed such that those are no longer guaranteed to be
placed at zero, tests would break when they shouldn't.
2019-09-23 01:28:48 +02:00
Anthony J. Bentley
a517f900e4 Use POSIX-compatible dd(1) instead of head -c. 2019-08-30 23:11:28 -06:00
mid-kid
c63af05427 Allow linker script to consider section attributes
The linker script now allows you to assign a section with the same
attributes as in the source.
To do this, I've removed a check from AssignSectionAddressAndBankByName
that would never be triggered, due to that condition being checked
before. Shouldn't this and IsSectionSameTypeBankAndAttrs be condensed
into a single function?
2019-01-18 12:37:23 +01:00
Antonio Niño Díaz
0727eb4374 Add test to verify hex codes of all instructions
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2018-01-27 14:38:52 +00:00
Ben10do
4be92e14e6 Add shebang to test shell scripts
This ensures that the test scripts are correctly run with the Bourne shell, regardless of the (potentially more exotic) shell that is used to invoke the script.
2017-07-20 19:21:06 +01:00
Antonio Niño Díaz
f2724df566 Fix rgblink error messages about prohibited sections
Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2017-04-23 20:45:39 +02:00
Antonio Niño Díaz
2b5ad9dc38 Make test scripts return error code
Make them executable.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2017-04-10 22:10:10 +01:00
Antonio Niño Díaz
5679c7066b Restore behaviour of option -w and add option -d
rgblink option -w has been restored to its previous behaviour: make WRAM
a continous section instead of spliting it into WRAM0 and WRAMX.

To enable DMG mode, option -d has to be used instead. This option
automatically enables -w.

Update tests.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2017-04-10 20:03:52 +01:00
Antonio Niño Díaz
3d8396b86f Remove progname variable
The error message shouldn't specify the name of the binary, that's
supposed to be known by the caller.

Update test reference outputs.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2017-04-08 18:10:14 +01:00
Antonio Niño Díaz
e3109af2f8 Rename OPT_CONTWRAM to OPT_DMG_MODE
Now, it will also make sure that VRAM bank 1 isn't used.

Man page updated.

Tests added.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2017-04-08 18:08:51 +01:00
Antonio Niño Díaz
dda3a066be Add test for HIGH() and LOW()
It compares the results of the operators with the expected result if
doing the same thing manually.

Signed-off-by: Antonio Niño Díaz <antonio_nd@outlook.com>
2017-04-06 22:40:38 +01:00
AntonioND
7e107ab41a Update references of linker tests
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-04 23:13:42 +01:00
AntonioND
720ae59af8 Merge pull request #154 from AntonioND/an/tiny-contwram
Make the options -t and -w of rgblink consistent
2017-04-04 21:42:20 +01:00
AntonioND
2abdc9c59d Add whitespace to error and warning messages
Test reference output updated.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-03 23:46:19 +01:00
AntonioND
f431b384a2 Add tests for rgblink options -t and -w
Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-03 21:29:22 +01:00
AntonioND
e16af28676 Automate and improve rgblink test
Check all sections when testing BANK().

Add scripts to verify the tests and update the reference if needed.

Signed-off-by: AntonioND <antonio_nd@outlook.com>
2017-04-03 21:19:39 +01:00
Anthony J. Bentley
bc60b85785 Support BANK() correctly when given WRAMX/SRAM/VRAM labels.
(Mostly) from Antonio Niño Díaz.
2015-02-22 03:33:18 -07:00