Skip to content

Commit e0e759e

Browse files
committed
update test file generator
1 parent 3e7ee6c commit e0e759e

File tree

3 files changed

+1
-10
lines changed

3 files changed

+1
-10
lines changed

UNITTESTS/README.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,6 @@ Each class to be tested requires two files for unit testing:
203203

204204
A unit test definition file `unittest.cmake` requires variables to be set for a test to be configured. File source paths in `unittest.cmake` files need to be relative to the unit test folder and `CMakeLists.txt`.
205205

206-
* **TEST_SUITE_NAME** - Identifier for the test suite. Use naming convention *PATH_TO_THE_TESTABLE_FILE* e.g. *features-netsocket-InternetSocket*
207206
* **unittest-includes** - Include paths for headers needed to build the tests in addition to the base include paths listed in [CMakeLists.txt](CMakeLists.txt). Optional.
208207
* **unittest-sources** - Mbed OS source files and stubs included for the build.
209208
* **unittest-test-sources** - Unit test source files.
@@ -225,8 +224,6 @@ For example to create a unit test for `rtos/Semaphore.cpp`:
225224
1. Create a directory for unit test files in `UNITTESTS/rtos/Semaphore`.
226225
2. Create a test definition file `UNITTESTS/rtos/Semaphore/unittest.cmake` with the following content:
227226
```
228-
set(TEST_SUITE_NAME "rtos-Semaphore")
229-
230227
set(unittest-sources
231228
stubs/mbed_assert.c
232229
../rtos/Semaphore.cpp

UNITTESTS/template/unittest.cmake.template

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33
# UNIT TESTS
44
####################
55

6-
# Unit test suite name
7-
set(TEST_SUITE_NAME "suitename")
8-
96
set(unittest-includes ${unittest-includes}
107
headerfile
118
)

UNITTESTS/unit_test/new.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class UnitTestGeneratorTool(object):
2828
Generator tool to create new unit tests from template
2929
"""
3030

31-
def _replace_content(self, template_content, dirname, classname, suite_name, extension):
31+
def _replace_content(self, template_content, dirname, classname, extension):
3232
if extension == "h":
3333
content = re.sub(r"cppfile",
3434
"",
@@ -41,7 +41,6 @@ def _replace_content(self, template_content, dirname, classname, suite_name, ext
4141
content = re.sub(r"headerfile", "../dirname/template.h", content)
4242
content = re.sub(r"dirname", dirname, content)
4343
content = re.sub(r"template", classname, content)
44-
content = re.sub(r"suitename", suite_name, content)
4544

4645
return content
4746

@@ -111,7 +110,6 @@ def create(self, mbed_os_root=None, filepath=None):
111110
content = self._replace_content(template_content,
112111
dir_name,
113112
class_name,
114-
suite_name,
115113
file_extension)
116114

117115
output_file.writelines(content)
@@ -130,7 +128,6 @@ def create(self, mbed_os_root=None, filepath=None):
130128
content = self._replace_content(template_content,
131129
dir_name,
132130
class_name,
133-
suite_name,
134131
file_extension)
135132

136133
output_file.writelines(content)

0 commit comments

Comments
 (0)