vhelin / wla-dx

WLA DX - Yet Another GB-Z80/Z80/Z80N/6502/65C02/65CE02/65816/68000/6800/6801/6809/8008/8080/HUC6280/SPC-700/SuperFX Multi Platform Cross Assembler Package
Other
547 stars 98 forks source link

Testing Framework #105

Closed bazz1tv closed 2 years ago

bazz1tv commented 8 years ago

I'm not sure if WLA-DX has "got the ball rolling" toward having unit tests, but it's damn time to have a testing framework.

If anyone has an idea of key testing areas, or towards a proper approach... I'm listening.

bazz1tv commented 8 years ago

For anyone who doesn't yet realize why a testing framework is great; It helps ensure that nothing breaks from new changes to code. At least, that's the point. And new tests are created for new features when they are added.

For something like WLA-DX it's important because sometimes a change to "module-A" could break something in "module-Z" unknowingly. The tests could possibly detect such an instance.

Unfortunately, tests are created by humans, so nothing is perfect.

cr1901 commented 8 years ago

I have a branch for this that utilizes ctest, but it's out of date. Also WLA currently isn't all that suited for unit testing. We have the test files and bug exhibition directories, but not functions which can be pulled out and tested individually.

cr1901 commented 8 years ago

I would love to get ctest up and running for the existing test files, but I'm currently not able to work on WLA meaningfully.

vhelin commented 8 years ago

Unit testing WLA DX (linker and especially the buggier assembler) would be super nice! Our current tests really don't tell that much, and are far outside the core code... But before that's possible a lot of huge functions need to be split into smaller ones and made more independent. Perhaps one at a time, one function gets refactored, then ctests for it, rinse and repeat... I've never used ctest myself either, and can't promise to do much in the following 50 days. Up to +35C every day here on the Philippines (and later Thailand), it's even hard to remember to eat and drink enough. For working I'd need an aircon room with working wifi, and that'd be luxury (e.g. expensive) here... :)

On 19 Apr 2016 10:24, "William D. Jones" notifications@github.com wrote:

I would love to get ctest up and running for the existing test files, but I'm currently not able to work on WLA meaningfully.

— You are receiving this because you are subscribed to this thread. Reply to this email directly or view it on GitHub

vhelin commented 3 years ago

Ok, it's 2021 now, and I'm happy just writing tests for the assembled binaries. If anyone wants to start unit testing WLA's code then that's more than nice, but I'm targeting my efforts into fixing old bugs, adding new features and testing that what WLA assembles is and stays correct (using byte_tester.exe).

vhelin commented 2 years ago

Getting back to this in late 2022:

"For anyone who doesn't yet realize why a testing framework is great; It helps ensure that nothing breaks from new changes to code."

This is what our tests in the /tests folder test (by running run_tests.sh).

In my years as a software engineer (or software developer, I think that's a better title) I've found out that unit tests tend to test trivial things and they are really not that useful anywhere. Instead adding new tests to the /tests folder that test that the assembler and the linker really work as they should is the way to go, if you ask me. That is all that matters that they produce the expected output in the end.

And for that we have "duplicate" issue https://github.com/vhelin/wla-dx/issues/376 - thus I'm closing this issue.