Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
You are not logged in 
CSDb User Forums

Forums > C64 Coding > c64unit test framework - alpha version
2017-07-30 20:42
Bago Zonde

Registered: Dec 2010
Posts: 28
c64unit test framework - alpha version

Hi guys!

I would like to announce that c64unit unit test framework entered alpha stage. If you have any feedback, feel free to share here. Any suggestions are welcome!

c64unit framework package: https://bitbucket.org/Commocore/c64unit
Examples: https://bitbucket.org/Commocore/c64unit-examples

And this is the place where c64unit was born, while working on A* pathfinding algorithm for Steel Duck game project (still in progress): A* pathfinding algorithm repository.

Currently c64unit supports 4 cross-assemblers: 64tass, DASM, Kick Assembler and ACME. Please let me know if your cross-assembler of choice is missing here.

Happy testing!

Hail C64 scene!

2017-08-01 08:41

Registered: Oct 2012
Posts: 27
Nice work! I have something similar in use, but somewhat simpler and targeted for my own personal use. I feel that supporting ca65 syntax might be good, as this is definitely my (and maybe others'?) choice for large projects that rely on a separation between compiler and linker.
2017-08-02 21:18

Registered: Jan 2008
Posts: 242
I wonder what are differences between this project http://64bites.com/64spec/ and yours with exception of supporting multiple assemblers? Never had time to check out both project so I am asking out of curiosity.
2017-08-03 22:58
Bago Zonde

Registered: Dec 2010
Posts: 28
There were few reasons behind creating unit test framework, but to fully answer your question I will try to explain it from the beginning. Well, this is my understanding, so if you have other opinions, feel free to discuss here :).

The genesis of c64unit is simply a need to test one algorithm I was working on. And, as 64tass is my cross-assembler of choice (which I adore, and I don't regret even for a second), I just created few simple assertions in 64tass. I was aware of 64spec at the time, but as I wasn't able to use it with 64tass, that was the natural direction.

64spec seems to be a quite powerful tool, but even though, it doesn't contain assertions for set of data as far as I've seen. You can assert set of bytes using assert_bytes_equal pseudocommand but this one is actually static. In my case I needed to introduce data providers, which can do two things. First of all, they are dynamic, which means that result from examined function can be asserted against expected value on the fly. And the second, these handlers are able to set input parameters for called function (A, X, Y registers, etc.) and also, you can set any address locations before calling the function if you have to. Then you can execute the function, and make dynamic assertion to compare with your expected value. Operation continues in loop until the last expected iteration of data set. This behaviour was a must have in my case as algorithm needed a variety of data to be initialized for each test case.

You'll find the real world example here: https://bitbucket.org/Commocore/a-star-pathfinding-in-6510/src/..

So, that was something asking to be implemented. Then, after couple of months I realized, that it started to be an extremely handy tool for me so I started to hunt for features I'm missing.

And then, I've found that actually I have to mock some functionality! So this is another difference that c64unit can mock/stub some functions, while 64spec cannot.

After all that crazy time when I was creating all that features, I realized that it's actually not a bad idea to make it available for our community. And from then, I think I became crazy myself when the idea of enabling it for a variety of cross-assemblers came to my mind. Challenging mostly in terms of time spent, but as I've found again - everything is possible, and what's impossible just takes more time :).

To conclude, the main difference is the approach taken, I believe. 64spec is focusing on low-level testing of assembly code, while c64unit took a different approach, and it's focused on unit testing. I really found 64spec an interesting tool, and inspiring though.

But the direction I went is quite different now, and as c64unit is in alpha version, I will see how it can be extended for additional features. Feel free to share some ideas :).

RefreshSubscribe to this thread:

You need to be logged in to post in the forum.

Search the forum:
Search   for   in  
All times are CET.
Search CSDb
Users Online
Black Beard/Abyss, A..
Heavy Stylus/RGCD
Guests online: 40
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 Comaland 100%  (9.6)
5 The Shores of Reflec..  (9.6)
6 Wonderland XII  (9.6)
7 Lunatico  (9.6)
8 We Come in Peace  (9.5)
9 Incoherent Nightmare  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 FMX Music Demo  (9.6)
2 Daah, Those Acid Pil..  (9.5)
3 Pandemoniac Part 2 o..  (9.5)
4 Treu Love [reu]  (9.5)
5 Merry Xmas 2017  (9.4)
6 Arok 20 Invitation  (9.4)
7 Dawnfall V1.1  (9.4)
8 In Memoriam BHF  (9.4)
9 Dawnfall  (9.4)
10 Synthesis  (9.4)
Top Groups
1 Oxyron  (9.4)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Finnish Gold  (9.4)
5 Crest  (9.3)
Top Musicians
1 Rob Hubbard  (9.8)
2 Jeroen Tel  (9.6)
3 LMan  (9.6)
4 Drax  (9.5)
5 Linus  (9.5)

Home - Disclaimer
Copyright © No Name 2001-2018
Page generated in: 0.081 sec.