-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #43 from exoticlibraries/dev
Dev
- Loading branch information
Showing
42 changed files
with
868 additions
and
342 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,4 +17,6 @@ Documentation | |
macros | ||
fixtures | ||
assertions | ||
testing_stream | ||
testing_stream | ||
selective_compilation | ||
known_issues |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
|
||
.. index:: | ||
single: known_issues | ||
|
||
Known Unfixed Issues | ||
======================== | ||
|
||
There are some issues detected that cannot or has not not been fixed in the framework, and some | ||
features that is close to impossible to implements, these two group of farts are highlighted here: | ||
|
||
C++ Dynamic Deallocation | ||
------------------------------------------- | ||
|
||
In C++ it impossible to use the shared test instance variable to share objects that are automatically | ||
deallocated when they fall out of scope. For example if a **std::vector** object is to be used to | ||
share data across multiple test case and the data is added to the vector object in one of the | ||
fixture function (CESTER_BEFORE_ALL, CESTER_BEFORE_EACH), all the test cases relying on the data | ||
will fail as the vector object will call it deallocator at the end of the fixture function, hence | ||
it will be null in all the test cases. | ||
|
||
The solution in this case is to use the global scope for such object and not the `shared_instance->arg` | ||
variable, the `shared_instance->ar` will work fine for dynamically allocated objects. | ||
|
||
Instead of | ||
|
||
.. code:: c | ||
//... | ||
CESTER_BEFORE_ALL(inst, | ||
std::vector<int> setup; | ||
inst->arg = & setup; | ||
) | ||
CESTER_TEST(vector_push_back, inst, { | ||
std::vector<int> setup = *(std::vector<int> *)(inst->arg); | ||
setup.push_back(20); | ||
}) | ||
//... | ||
Define in global scope instead | ||
|
||
.. code:: c | ||
//... | ||
CESTER_BODY( | ||
std::vector<int> setup; | ||
) | ||
CESTER_TEST(vector_push_back, inst, { | ||
setup.push_back(20); | ||
}) | ||
//... | ||
This isssue was reported `MarcelInTO <https://github.com/MarcelInTO>`_ in issue | ||
`50 <https://github.com/exoticlibraries/libcester/issues/50>`_. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
|
||
.. index:: | ||
single: selective_compilation | ||
|
||
Selective Modular Features | ||
============================= | ||
|
||
libcester is build in a very modular manner such that most of the component can be removed and | ||
the main feature which is running and reporting test still take place. By excluding some features | ||
the generated binary will be smaller compare to when all the features are left to | ||
be compiled, by excluding some features libcester is guaranteed to work on various platforms even | ||
with very minimal resources. | ||
|
||
|
||
Do not Include windows.h | ||
------------------------- | ||
|
||
Including the **windows.h** header causes problem in some test, so it important to provide | ||
solution in such case. By defining the macro `CESTER_EXCLUDE_WINDOWS_H` the windows.h file will | ||
not be included in the test. | ||
|
||
The main reason for including the windows.h in libcester is just for printing the text output format with | ||
color as the windows terminal by default does not recognize the ASI escape code without changing | ||
the mode. So this means that on windows terminal with the old mode the raw ansi code will be written | ||
into the terminal else the option is set to no color. This will also disable the execution of test | ||
case in independent processes and will rely on signal for recovery from critical error on windows. | ||
|
||
The issue related to this was first reported by `MarcelInTO <https://github.com/MarcelInTO>`_ in the pr | ||
`47 <https://github.com/exoticlibraries/libcester/pull/47>`_. | ||
|
||
Exclude time report | ||
------------------------ | ||
|
||
Time keeping causes problem for test which are built for execution on a platform that does not have | ||
a proper time keeping mechanism or does not support floating point data types, example of such platform | ||
is the PlayStation 1. | ||
|
||
By defining the macro `CESTER_NO_TIME` before including cester.h all the time keeping feature will be | ||
disabled, this also reduce the generated binary by 3kb on Windows 10 64 bit compiled with GCC version 10 | ||
with one test case. This feature was introduced by `nicolasnoble <https://github.com/nicolasnoble>`_ in | ||
the pr `14 <https://github.com/exoticlibraries/libcester/pull/14>`_. | ||
|
||
By removing this feature all time related feature such as keeping record of how long a test case | ||
execution take, specifying how long a test case should run will be disabled. | ||
|
||
Remove recovery with signal.h | ||
------------------------------- | ||
|
||
On a platform that does not support running test case on their seperate processes, libcester rely on | ||
signal.h to recover from critical faulure such as segfault. But in a situation when you are sure | ||
any of the test case will not crash you can disable signal.h recovery by defining the macro | ||
`CESTER_NO_SIGNAL`. | ||
|
||
By disabling signal revovery method the generated binary size reduce by 1kb on Windows 10 64 bit | ||
compiled with GCC version 10 with one test case. | ||
|
||
Disable memory test | ||
--------------------- | ||
|
||
The framework has a very minimal memory test feature that track the amount of memory allocated, | ||
it lifecycle and report failure for the test case if it leak any memory, try to use freed memory or | ||
trying to free an already freed memory. | ||
|
||
This feature is optional as it might cause issues on some platform, this can also be diabled by | ||
defining the macro `CESTER_NO_MEM_TEST` before including cester.h this reduces the generated binary | ||
size reduce by 2kb on Windows 10 64 bit compiled with GCC version 10 with one test case. | ||
|
||
Select Reporter To Compile | ||
---------------------------- | ||
WIP | ||
|
||
Exclude JunitXml Report | ||
'''''''''''''''''''''''' | ||
WIP | ||
|
||
Exclude Text Report | ||
''''''''''''''''''''' | ||
WIP | ||
|
||
Exclude Tap Report | ||
'''''''''''''''''''' | ||
WIP | ||
|
||
Exclude TapV13 Report | ||
''''''''''''''''''''' | ||
WIP |
Oops, something went wrong.