Commit Graph

553 Commits

Author SHA1 Message Date
Rangi42 6d4a61f51d Fix some numeric bases in RGBLINK output 2024-03-06 17:43:26 -05:00
Rangi42 75105016f7 Make sure that parsed subexpressions are fully defined
We were not initializing some expressions, and they were using
the values of the previous expressions instead. This just so
happened to not crash the tests, and to sometimes even give valid
results (although `BANK()` of a non-label symbol being $4B4E4142,
the ASCII balue of "BANK", was something we missed).
2024-03-06 16:00:55 -05:00
Sylvie e74073e480 Run clang-format on everything (#1332) 2024-03-04 14:22:49 -05:00
Sylvie f8dab23e8f Use uncommented sizes for pointer-to-array arguments (#1329)
This is syntactically valid despite not being enforced, and
is a feature we already use elsewhere.
2024-03-03 19:43:08 -05:00
Eldred Habert 0da216897a Improve tests a little (#1324)
* Avoid redirecting error messages in RGBLINK tests

We check that RGBLINK prints nothing to stdout, so all that
would be captured on stdout is a putative failure message.

* Require each RGBLINK test to check error output

Otherwise, you can have a test that just... checks nothing!

* Document how to add tests

Fixes #1300's last remaining item.
Also add `checkdiff` rules to remind us to update that doc if
any of the test driver scripts are updated.
2024-03-03 19:12:29 -05:00
Evie 6b67c82b94 Implement -c #none (#1301)
Also adds a test case for round-tripping `-r` with `-c #none`.
2024-03-03 18:45:33 -05:00
Rangi42 d812acff24 Check RGBGFX warning/error format strings with format_ macro 2024-03-02 23:17:54 -05:00
Rangi42 2e1b0b6421 Remove commented-out C-only macro features 2024-03-02 20:17:22 -05:00
Sylvie 701b926288 Use RAII std::string and std::vector in randtilegen (#1325) 2024-03-02 11:02:26 -05:00
Sylvie 043db49676 Replace NULL with nullptr (#1321) 2024-02-29 15:06:33 -05:00
Sylvie eff8c324c8 Remove now-unnecessary struct keyword (#1320)
C++ acts like structs are `typedef`ed by default

We do have to keep `struct stat`, since there's ambiguity
with the function also called `stat`.
2024-02-29 14:41:58 -05:00
Rangi42 e90084ad06 Rename isWRA0Mode to isWRAM0Mode 2024-02-29 13:44:08 -05:00
Rangi42 a24df27cd8 Use std::vector for charmap output 2024-02-29 13:44:08 -05:00
Rangi42 d53bba97e8 Remove our custom hashmap 2024-02-29 13:44:08 -05:00
Rangi42 f44701c02d Use std::map for rgblink symbols and sections 2024-02-29 13:44:08 -05:00
Rangi42 3da201b26e Give explicit test output if the scramble-romx size is wrong 2024-02-26 18:26:17 -05:00
Sylvie b66212e6d6 Fix fstack traces for macro nodes (#1318)
Since the lexer rewrite, MACRO nodes' fstack traces have not
included their parent REPT nodes' names.
2024-02-24 20:23:25 -05:00
Sylvie c0d534f5ad No more flexible array members (not standard C++) (#1307)
* Replace FAMs with `std::vector`s (or one `std::string`) in four `struct`s

* Anonymous types declared in an anonymous union are also non-standard
  Only Clang complains about this (-Wnested-anon-types)
2024-02-22 16:22:37 -05:00
Sylvie a02687a83e Fix behavior of non-ASCII bytes with INCHARMAP (#1308) 2024-02-19 08:09:55 +01:00
Rangi42 f00e57a0ed Log indiviual rgblink test variants 2024-02-18 19:37:19 -05:00
ISSOtm 18e83c17b4 Add a few more linker script tests 2024-02-19 00:23:08 +01:00
ISSOtm 1b08a12b26 Ensure that mid-section align 16 makes PC constant
This makes `align 16` a sort of `org`, which is *very* useful :)
2024-02-18 17:53:56 -05:00
ISSOtm 36dad4380e Honor alignment offset for ALIGN[16, N]
The *one* place where it was missed...
2024-02-18 17:53:56 -05:00
ISSOtm b100c8ebee Add several tests for linker script syntax
Fixes a slice of #1276
2024-02-18 23:25:58 +01:00
ISSOtm 0769694839 Report mismatched file better when diff fails 2024-02-18 23:25:58 +01:00
ISSOtm 4064e4a7a9 Only look for linkerscripts in the same dir as the asm file 2024-02-18 23:25:58 +01:00
Sylvie d71a161bc9 Phrase error messages as "Failed to", not "Could not" or "Couldn't" (#1298) 2024-02-18 14:52:31 +01:00
Sylvie ef0d973187 Truncate long format spec strings before using them (#1299)
Fixes #1293
2024-02-18 14:27:03 +01:00
Rangi b0f2f0ffd6 Allow fewer tRNS entries than PLTE colors (#1284) 2023-12-31 12:47:53 +01:00
Rangi fdd45ab1dc Improve linker script align (#1271)
An offset is now supported, and invalid values are no longer silently
truncated, aligning behaviour with other instances of the directive.
2023-12-18 07:16:48 +01:00
Rangi 39018174c5 Scramble banks from the end of the ROM (#1273)
This is more likely to test edge cases, such as having content in banks with their highest bit set.
2023-12-17 20:14:03 -05:00
Rangi b886b7e611 Add LADX disassembly to test suite (#1265) 2023-12-11 18:21:38 +01:00
Eldred Habert fd78a9ae83 Port linkerscript parser to Bison (#1266)
Notable side effects:
* Use the standard-conformant MSVC preproc
* Add test for linker script INCLUDE
* Improve wording of placement conflict errors
* Fix errors from not newline-terminated files
* Teach checkdiff about the linker script doc
* Call linker script "commands" "directives" instead

---------

Co-authored-by: Rangi42 <remy.oukaour+rangi42@gmail.com>
2023-12-11 02:29:37 +01:00
Rangi 34b2543c8b Implement -X/--max-errors for RGBASM (#1262)
Co-authored-by: Eldred Habert <me@eldred.fr>
2023-12-07 11:42:47 +01:00
Rangi 1fa289f2ee Add SameBoy's BootROMs to the test suite (#1264) 2023-12-06 22:37:59 +01:00
Rangi 22ff7ff101 Add PinoBatch's game Libbet to the test suite (#1260) 2023-12-06 10:30:11 +01:00
Rangi 6132b77c1e Add more tests for RGBASM code coverage (#1257)
* Add more tests for RGBASM code coverage

* Use C++ unnamed parameters, not `(void)` casting

* Fix crash in `sect_AlignPC` from #1253
2023-12-01 10:21:43 -05:00
Rangi cee3d1c859 Add more test coverage for RGBASM (#1256)
This also fixes two bugs: `-1 >>> 32` was -1 not 0, and `macro_FreeArgs` should have been called but wasn't.
2023-11-29 15:16:05 -05:00
Rangi42 b46aa0f55b colour->color, behaviour->behavior
These spellings are more common elsewhere in the codebase
2023-11-27 16:02:17 -05:00
Rangi 2ebd7f2ea3 Allow negative alignment offsets (#1255) 2023-11-25 09:40:20 +01:00
Rangi 92836408cc Remove empty .out and .err test files (#1249)
Co-authored-by: ISSOtm <me@eldred.fr>
2023-11-24 17:52:55 -05:00
ISSOtm 6f0defbfe5 Fix shellcheck warnings in the test scripts
Making them more robust to changes.
We ought to automate this some day.

My version of ShellCheck (v0.9.0) errors on test/gfx/test.sh, though...
2023-11-24 20:54:28 +01:00
Rangi 46e29de66f Implement ds align[alignment, offset] (#1181) 2023-11-21 23:57:47 +01:00
Eldred Habert 99671b8eb5 Avoid building test support programs by default with CMake (#1244)
Copy CMake-built test executables to test directory

Fixes CI failures on Windows.
CI should also have failed on Unices, but it turns out
we instead merely hit the fallback that the `make` path
relies on (building those executables with `make`),
which fails on Windows since `make` is not set up to
find libpng.
2023-11-21 09:54:22 -05:00
Rangi 3c0879a3c6 Fix spurious truncation warning (#1238) 2023-11-20 22:51:51 +01:00
Rangi 8eeb40cca8 Implement #"raw strings" (#1122)
Fixes #1121
2023-11-07 23:48:23 +01:00
Rangi 9fc088dcb0 Fix the FOR loop count formula (#1222) 2023-11-07 23:43:46 +01:00
Rangi 1e70e703a7 Build everything as C++ (#1176) 2023-11-07 21:45:56 +01:00
Rangi42 02f9128d07 Make some changes noticed while porting to C++ 2023-11-07 08:27:03 +01:00
Rangi 28358b55fe Separate multiple instructions per line with :: (#1210) 2023-11-05 19:13:33 +01:00