[asterisk-dev] [Code Review] Unit Test Framework
Russell Bryant
russell at digium.com
Fri Dec 18 17:10:34 CST 2009
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/447/#review1336
-----------------------------------------------------------
/trunk/include/asterisk/test.h
<https://reviewboard.asterisk.org/r/447/#comment3067>
Use retval here
/trunk/main/test.c
<https://reviewboard.asterisk.org/r/447/#comment3069>
You can throw one more const in here
/trunk/main/test.c
<https://reviewboard.asterisk.org/r/447/#comment3070>
There is nothing wrong with this, but FWIW, the 0, 1, and 2 are no-ops here.
/trunk/main/test.c
<https://reviewboard.asterisk.org/r/447/#comment3071>
The "proper" doxygen way to do an enumerated list is to use "-#" instead of 1., 2., 3.
See this link for more info:
http://www.stack.nl/~dimitri/doxygen/lists.html
/trunk/main/test.c
<https://reviewboard.asterisk.org/r/447/#comment3068>
I would like to change how these default paths work. Specifically:
1) I would like to use an absolute path. I suppose ast_config_AST_LOG_DIR is the most appropriate default base for the path.
2) I would like the output filename to be unique for every test run. You could use a timestamp or a simple monotonically increasing integer as a part of the filename.
/trunk/tests/test_heap.c
<https://reviewboard.asterisk.org/r/447/#comment3072>
Now that you changed how this API works, you can undo some of these changes and add back the status update.
- Russell
On 2009-12-17 15:19:29, David Vossel wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/447/
> -----------------------------------------------------------
>
> (Updated 2009-12-17 15:19:29)
>
>
> Review request for Asterisk Developers and Russell Bryant.
>
>
> Summary
> -------
>
> The Unit Test Framework is a new API that manages registration and execution of unit tests in Asterisk with the purpose of verifying the operation of C functions.
>
> The Framework consists of a single test manager accompanied by a list of registered test functions defined within the code. A test is defined, registered, and unregistered from the framework using a set of macros which allow the test code to only be compiled within asterisk when the TEST_FRAMEWORK flag is enabled in menuselect. This allows the test code to exist in the same file as the C functions it intends to verify. Registered tests may be viewed and executed via a set of new CLI commands. CLI commands are also present for generating and exporting test results into xml and txt formats.
>
> For more information and use cases please refer to the documentation provided at the beginning of the test.h file.
>
>
> Diffs
> -----
>
> /trunk/build_tools/cflags-devmode.xml 235429
> /trunk/include/asterisk/_private.h 235429
> /trunk/include/asterisk/test.h PRE-CREATION
> /trunk/main/asterisk.c 235429
> /trunk/main/test.c PRE-CREATION
> /trunk/tests/test_heap.c 235429
>
> Diff: https://reviewboard.asterisk.org/r/447/diff
>
>
> Testing
> -------
>
> test_heap.c has been modified to take advantage of the Test Framework. I have executed and generated reports for these tests.
>
>
> Thanks,
>
> David
>
>
More information about the asterisk-dev
mailing list