Log inRegister an accountBrowse CSDbHelp & documentationFacts & StatisticsThe forumsAvailable RSS-feeds on CSDbSupport CSDb Commodore 64 Scene Database
 Welcome to our latest new user Brizio ! (Registered 2017-08-20) You are not logged in 
CSDb User Forums

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

Registered: Dec 2010
Posts: 21
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 10:41

Registered: Oct 2012
Posts: 23
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 23:18

Registered: Jan 2008
Posts: 230
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-04 00:58
Bago Zonde

Registered: Dec 2010
Posts: 21
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
Guests online: 55
Top Demos
1 Uncensored  (9.7)
2 Edge of Disgrace  (9.7)
3 Coma Light 13  (9.6)
4 The Shores of Reflec..  (9.6)
5 Lunatico  (9.6)
6 Comaland 100%  (9.5)
7 Incoherent Nightmare  (9.5)
8 Wonderland XII  (9.5)
9 Comaland  (9.5)
10 Wonderland XIII  (9.5)
Top onefile Demos
1 Veterans of Style  (9.5)
2 Dawnfall V1.1  (9.5)
3 Daah, Those Acid Pil..  (9.5)
4 Treu Love [reu]  (9.4)
5 Dawnfall  (9.3)
6 SidRok  (9.3)
7 F1 Evolution  (9.3)
8 One-Der  (9.2)
9 Tunnel Vision  (9.2)
10 Game of Thrones [2sid]  (9.1)
Top Groups
1 Pond  (10)
2 Booze Design  (9.4)
3 Censor Design  (9.4)
4 Oxyron  (9.4)
5 Crest  (9.3)
Top Original Suppliers
1 Derbyshire Ram  (9.3)
2 hedning  (9.2)
3 Jazzcat  (9.1)
4 Fungus  (9.0)
5 Irata  (9.0)

Home - Disclaimer
Copyright © No Name 2001-2017
Page generated in: 0.212 sec.