unittests #9

Merged
omicron merged 7 commits from unittests into main 2025-04-06 07:28:52 +00:00

7 Commits

Author SHA1 Message Date
2bea87b39a Run tests in the validate gitea action
All checks were successful
Validate the build / validate-build (push) Successful in 29s
2025-04-06 09:23:25 +02:00
2eb7b3c2f1 use llvm to generate test coverage 2025-04-06 09:17:51 +02:00
f1f4c93a8e Fix bug in lexer_next_number not correctly tracking character number
All checks were successful
Validate the build / validate-build (push) Successful in 28s
When a number has a suffix the lexer state didn't record the number of
characters consumed for this suffix. This made the lexer state be 2-3
characters short in its line location reporting until it encountered a
newline character. It did not otherwise corrupt the state of the lexer.
2025-04-05 01:41:40 +02:00
27099c9899 Add initial unit tests
- Add µnit source and header files
- Add test target to the build system
- Implement a thorough lexer test suite
- Implement a minimal AST test suite
2025-04-05 01:37:04 +02:00
3fead8017b Rename lexer errors 2025-04-05 01:37:04 +02:00
af66790cff Clean up error definitions, location and expose them in the headers
- Exposes all errors in the header file so any user of the api can test
   for the specific error conditions
 - Mark all static error pointers as const
 - Move generic errors into error.h
 - Name all errors err_modulename_* for errors that belong to a specific
   module and err_* for generic errors.
2025-04-05 01:37:04 +02:00
cb8768b1d0 Make clangd aware of the _POSIX_C_SOURCE define in the build system 2025-04-05 01:37:04 +02:00