views:

277

answers:

4

I come from a C++ background, but I'm currently working in Ada. In the C++ world, I unit test every class as I write it... this doesn't seem to be the vogue for our codebase here at work.

I'd like to start implementing unit tests for the Ada packages I create, are there any good frameworks out there that do this?

+1  A: 

Check out AUnit

Alex B
+1  A: 

VectorCAST/Ada has been around for awhile.

Marc C
+2  A: 

There are two open source JUnit-like unit testing frameworks around, AUnit and Ahven.

AUnit is good if you use Ada 2005 and GNAT compiler family. Downside is that you cannot use it in Ada 95 projects. Ahven fills the gap and concentrates on being compatible with various Ada 95 compilers (like older GNAT compilers, Janus/Ada, ObjectAda).

(PS. I am author of Ahven.)

tkoskine
Thanks for pointing out that AUnit does not support Ada95 code.
ceretullis
+2  A: 

tkoskine says that AUnit doesn't support Ada95; don't know where that came from, I've been using AUnit for the last 8 years on a project which is still Ada95!

Simon Wright
I was wrong about that.AUnit 3.* needs an Ada 2005 compiler that understands pragma Ada_2005 in a unit to mean "this unit uses 05 features, but that's OK even if you're compiling in 95 mode". That means GNAT.This might be fixable.
Simon Wright