Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What unit testing frameworks are available for x86 assembler?

It seems that unit testing has become all the rage these days and I know many of you are going to think: "Well why not just use language X with framework Y already?" But I'm proposing this idea more as a proof of concept, or out of nostalgic remembrance for my earlier years with computer programming.

I'm namely working on BSD running on x86 with NASM, and have mulled over the use of shell scripting with expect(1) to do unit testing but I wanted to know beforehand:

What unit testing frameworks are available for applications written in x86 assembly?

like image 621
Dwight Spencer Avatar asked Mar 02 '12 06:03

Dwight Spencer


2 Answers

If your assembler routines have or can be given a 'C' interface, then any C/C++ unit testing framework can be employed.

You should move the vast majority of your application into a library which can be called from 'C' programs (ie a testing framework). To finally build your application you write an assembler front-end that just calls your new library.

like image 165
quamrana Avatar answered Nov 15 '22 13:11

quamrana


IMHO The notion of unit testing is not applicable to low-level languages such as assemblers. Unit testing associates with testing unit functionality of a method, class, procedure. In my opinion such things do not exist in assembly code - of course, it is possible to declare procedures in some assemblers (it was possible in TASM and MASM), but they are not something that do exist in machine code.

However, I think that we still can consider automated testing of assembly code. Personally, I haven't heard of any framework that would allow that.

like image 29
Lukasz Avatar answered Nov 15 '22 11:11

Lukasz