A very useful feature of the TestApe framework, is its ability to execute the same test
with a given list of parameters, e.g. a range between 0 and 255, or a set of strings
e.g. "", NULL, "SAMPLE" that is known to be of importance for the unit being tested.
This also gives the posibility to vary the test slightly, in order to achieve the final
increase in coverage.
Of course, this can be done by copying existing tests; changing a parameter here and
there and implementing new mocks.
However - it is much easier to use the possibility to execute a ranged test with
parameters using the macro PARAMETER, PARAMETER_RANGE, and
PARAMETER_SET.
These macros will prepare one or more values for the next executing test. Suppose you
want to test myfunc using a bool input parameter with values true and false, then
you would prepare the test using PARAMETER(true); PARAMETER(false); and execute
the test as using EXECUTE(myfunc)
Some more examples are shown in the the code below. In the sample directory, sample15 has a more complete working example.2.1
void interesting_integers(void) {
PARAMETER(0);
PARAMETER(-1);
PARAMETER_RANGE(128,255);
PARAMETER("some input string");
PARAMETER("");
PARAMETER(NULL);
EXECUTE(interesting_parameters);
}
This would generate the following output
Executing test interesting_parameters (step 1 of 133 using value 0) .... PASSED test interesting_parameters Executing test interesting_parameters (step 2 of 133 using value -1) .... PASSED test interesting_parameters .... Executing test interesting_integers (step 130 of 133 using value 255) .... PASSED test interesting_parameters Executing test interesting_integers (step 131 of 133 using value "some input string") .... PASSED test interesting_parameters Executing test interesting_integers (step 132 of 133 using value "") .... PASSED test interesting_parameters Executing test interesting_integers (step 132 of 133 using value NULL) .... PASSED test interesting_parameters
When testing a value in a range from one to 10000, the same test is literally executed 10000 times. This can take some time and generate huge logfiles. As an option, the amount of values tested, and/or the output generated, can be limited from the command line when invoking the test executable. See section [*]
testape
New is this release are support for floating point validations and function mocking. Also, MinGW has been added to the list of supported platforms.
moreTestApe forum is now hosted on Proboards. Support questions can be posted here or send directly on email. Due to ...
moreTestApe can now be used with MinGW GCC on windows. Also supported in this beta are floating point types in validations or when mocking functions
moreA small fix for webtty scripts, to allow the usage from Apple IPads. Tab on textarea to bring up IPad keyboard - you may have to scroll webpage beneath keyboard, in order to actually see what you're typing.
This release contains a new flexible mocking system with default mocks automatically generated for unresolved functions. Installation packages are available for GCC/Linux, GCC/CygWin as well Visual Studio 2009/Windows XP or Vista.
moreNew beta version is now available for download. This is the last beta before official release. The release supports an extensive mocking system.
moreThere is a change for the forum hosted on this site. The previous phpBB forum is closed for now. All forum threads will be migrated to a new simple blog. ...
more