aboutsummaryrefslogtreecommitdiffhomepage
path: root/errors_test.go
AgeCommit message (Collapse)Author
2024-10-18main: make sure typecheck errors are correctly reportedAyke van Laethem
2024-10-18loader: don't panic when main package is not named 'main'Ayke van Laethem
This can in fact happen in practice, so return an actual error message instead.
2024-08-11builder: interpret linker error messagesAyke van Laethem
This shows nicely formatted error messages for missing symbol names and for out-of-flash, out-of-RAM conditions (on microcontrollers with limited flash/RAM). Unfortunately the missing symbol name errors aren't available on Windows and WebAssembly because the linker doesn't report source locations yet. This is something that I could perhaps improve in LLD.
2024-07-20diagnostics: move diagnostic printing to a new packageAyke van Laethem
This is a refactor, which should (in theory) not change the behavior of the compiler. But since this is a pretty large change, there is a chance there will be some regressions. For that reason, the previous commits added a bunch of tests to make sure most error messages will not be changed due to this refactor.
2024-07-20main: add test for error coming from the optimizerAyke van Laethem
This is just one optimizer pass that's easy to test for. There are others, but I'm ignoring them for now. The one other that would be reasonable to test is when starting a goroutine with -gc=none, but I'm leaving that one for another time.
2024-07-20main: add error tests for the compilerAyke van Laethem
The compiler can in fact return errors, but these weren't tested yet.
2024-07-20main: add interp testsAyke van Laethem
This one needed more advanced checking of the error messages, because we don't want to hardcode things like `!dbg !10` in the output.
2024-07-20main: refactor error messages to use FileCheck-like patternsAyke van Laethem
Match the error messages in testdata/errors/*.go like LLVM FileCheck, which includes regular expressions. I believe this is much more flexible, and LLVM uses it in nearly all of their tests so it must work quite well for compilers.
2024-07-13loader: handle `go list` errors inside TinyGoAyke van Laethem
Instead of exiting with an error, handle these errors internally. This will enable a few improvements in the future.
2024-07-13all: add testing for compiler error messagesAyke van Laethem
This is needed for some improvements I'm going to make next. This commit also refactors error handling slightly to make it more easily testable, this should hopefully not result in any actual changes in behavior.