Commit Graph

582 Commits

Author SHA1 Message Date
Sylvie 3e9d2cab12 Make some error messages more consistent (#1393)
* Update some error messages

* Make non-A destination operand syntactically invalid
2024-04-20 23:13:01 +02:00
Sylvie 9ab3446d1a Fix two bugs with RGBASM fixed-point math (#1388)
- Fixed-point formulas are implemented using IEEE-754 floating-point
  internally, which could give infinity or NaN values whose conversion
  to fixed-point integer was platform-dependent.
- Formatting fixed-point $8000_0000 (INT32_MIN, -2147483648) was
  not putting the negative sign in front.
2024-03-31 12:53:20 -04:00
Rangi42 cf3e5e15f8 Update the 'ucity' commit used for testing
This reduces our need to patch it for compatibility
2024-03-29 14:42:23 -04:00
Sylvie 408a783fd8 Add more RGBLINK tests (#1386) 2024-03-29 14:30:32 -04:00
Rangi42 17afe611fd Update the 'libbet' commit used for testing
This reduces our need to patch it for compatibility
2024-03-29 13:35:12 -04:00
Sylvie 996db14ffa Make test built of 'libbet' reproducible with old Pillow versions (#1385)
The Python Pillow image library gives different output for
`Image.getcolors()` in version 9 than version 10. This causes
libbet's SGB border to be built differently, giving a different
ROM hash and technically failing the test script.

This patches libbet to only keep the known-good colors. It also
adapts the coverage script to run all the tests, including
building the third-party projects.
2024-03-29 11:59:36 -04:00
Sylvie 7326cc6875 Verify ROM hashes for all CI test projects (#1384)
Ucity and Libbet build files in a nondeterministic order, which
we have to patch to sort consistently for reproducible builds.
2024-03-28 22:37:33 -04:00
Rangi42 9dac583e45 Patch test projects so they build without deprecated features
Also ensure the test scripts pass shellcheck
2024-03-28 17:26:42 -04:00
Rangi42 230b1db438 Remove deprecated DEF-less definitions 2024-03-28 17:26:42 -04:00
Rangi42 14b72222b1 Remove the deprecated -H/-h/-L/-l options 2024-03-28 17:26:42 -04:00
ISSOtm e5078aba3b Clean up #includes
Remove unused headers, and avoid relying on transitive inclusions

`include-what-you-use` has been very useful for this!
2024-03-28 01:25:38 +01:00
Sylvie c075ffb570 Update test project commits (#1377) 2024-03-22 17:06:39 -04:00
Sylvie 96c808810f Remove .simple.err files, since we require Bison 3.0 (#1373) 2024-03-22 15:36:32 -04:00
Rangi42 507439bc25 Refactor macro args to be owned collectively by their fstack contexts 2024-03-22 14:25:36 -04:00
ISSOtm e255af9e10 Do not limit strings to 255 characters 2024-03-22 14:25:36 -04:00
ISSOtm 9f239f6dcc Use std::shared_ptr<std::string> for lexed/parsed strings 2024-03-22 14:25:36 -04:00
Sylvie f792580816 Only restore parent context's \@ value if it had one defined (#1366)
This way, if a child context initializes `\@`, the parent won't
reset it. And if the child context did not initialize `\@`,
then resetting it would be redundant.
2024-03-21 19:53:49 -04:00
Sylvie 554778da5b Built-in symbols are "<builtin>", not "<command-line>" (#1362) 2024-03-19 16:01:45 -04:00
Sylvie fec2266dd8 Use std::string for string-formatted values (#1360)
* Use `std::string` for string-formatted values

* Make `formatString` and `formatNumber` be `const`
2024-03-19 07:43:18 +01:00
Rangi42 d06376c170 Use std::unordered_map and std::vector for sections
This allows us to control the order in which sections are iterated,
instead of it depending on the internals of `std::map`. (This order
is arbitrary, but should be deterministic regardless.)
2024-03-16 11:51:47 -04:00
Sylvie 8ec0d01fc4 Sort .sym files in ascending order, and test for it (#1355) 2024-03-13 18:32:35 -04:00
Sylvie 658286c8e4 Move a SECTION FRAGMENT test to the test/link/section-fragment folder (#1354)
Add a binary comparison for the same-label SECTION UNION test
2024-03-13 15:34:27 -04:00
Sylvie 67c707739d Allow multiple identical exported numeric constants (#1341)
This still doesn't allow identical exported label constants.
That can be addressed when or if it's requested for a real use case.

Symbols only store one source filename + line number, so this
arbitrarily keeps the last read symbol as the reported one.
2024-03-13 14:06:20 -04:00
Sylvie 68f6ab5c32 Add test cases for SECTION UNION defining multiple identical labels (#1349)
Exported labels should fail to link; non-exported ones should be okay.
2024-03-13 13:34:44 -04:00
Rangi42 188fcfdd64 Add license header to test/CMakeLists.tst like the rest 2024-03-13 11:55:17 -04:00
Sylvie 4f15f07dd4 Refactor link/test.sh to avoid repeating test names (#1353) 2024-03-13 11:43:50 -04:00
Rangi42 e701faa1bc Print summaries at the end of test.sh scripts 2024-03-07 16:45:53 -05:00
Rangi42 2fd95381a6 Get rid of some fixed-size char buffers 2024-03-07 14:36:30 -05:00
Rangi42 7663a777d5 Remove 255-character limit on symbol names 2024-03-07 12:40:37 -05:00
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