โŒ About FreshRSS

Normal view

There are new articles available, click to refresh the page.
Before yesterdayNews from the Ada programming language world

AUnit - Usefullness of the `Test_Caller` package

There seem to be two different ways to do the same thing when using the AUnit library:

Using the AUnit.Test_Cases.Test_Case type, creating some function tests, then register each tests with the AUnit.Test_Cases.Register_Tests function. We can then add this Test_Case to a Suite using the function AUnit.Test_Suites.Add_Test.

There some example of this:

(Surprisingly, there no examples using this way in the AUnit repository.)

The other way is to use the AUnit.Test_Fixtures.Test_Fixture type, creating some function tests. These tests can then be added to a Suite using the generic package AUnit.Test_Caller with the functions AUnit.Test_Suites.Add_Test and AUnit.Test_Caller.Create.

I can see way of using Test_Caller in:

The only difference I can see is that, when using the AUnit.Test_Cases.Test_Case, you can override the Set_Up_Case, Set_Up, Tear_Down and Tear_Down_Case functions. While with the AUnit.Test_Fixtures.Test_Fixture you can only override the Set_Up and Tear_Down functions (because the tests are not group under a Test_Case).

Appart from that, I don't really see much difference.

So, what is the use of the AUnit.Test_Fixtures.Test_Fixture type with the generic package AUnit.Test_Caller ? Why would use this over the (simpler ?) AUnit.Test_Cases.Test_Case type ?

Every example I have seen in one format can be transformed into the other (the Set_Up_Case and Tear_Down_Case set appart). Could give an example which use one but cannot be done by the other ?

Test harness file is not creating for generic "when trying to test with generic instance"

while testing generic file thruogh instance in GNAT test AUnit framework.I am getting below error. Test harness is not creating for the file under test, which has generic; instead of that it is creating all other unwanted test harness files.

pal_api-btm-commands.ads:45:3: 
    error: corresponding test FAILED: Test not implemented. 
    (pal_api-btm-commands-test_data-tests.adb:44) 

pal_api-btm-commands.ads:55:3: 
    error: corresponding test FAILED: Test not implemented. 
    (pal_api-btm-commands-test_data-tests.adb:65)

Please let me know how to generate test harness file for generics which is implemented with its instance

โŒ
โŒ