| 1 |
Convert CppUTest files to Unity test files |
| 2 |
------------------------------------------ |
| 3 |
|
| 4 |
To convert a CppUTest test file to Unity, enter a command like this |
| 5 |
|
| 6 |
CONVERT=$CPPUTEST_HOME/scripts/convertToUnity/cpp_u_test_to_unity.rb |
| 7 |
|
| 8 |
ruby $CONVERT tests/some/dir/or/dirs/MyThink.cpp |
| 9 |
|
| 10 |
This will create two files like this |
| 11 |
|
| 12 |
unity/some/dir/or/dirs/MyThing.c |
| 13 |
unity/some/dir/or/dirs/MyThing_runner.c |
| 14 |
|
| 15 |
Things that need to be done manually once to your |
| 16 |
unity test environment: |
| 17 |
|
| 18 |
Create directory 'unity/some/dir/or/dirs' |
| 19 |
Adjust unity makefile to refer to the needed files |
| 20 |
Unity main needs to call RUN_TEST_GROUP(MyThing) |
| 21 |
|
| 22 |
Things not supported in converted test cases: |
| 23 |
CppUMock |
| 24 |
Hand built mocks that use CppUTest macros. |
| 25 |
Formatting conventions can cause the script to fail |