Skip to content

Commit 0189283

Browse files
author
Mohammad Azim Khan
committed
Code cleanup and debugs removed
1 parent 5578749 commit 0189283

File tree

2 files changed

+7
-31
lines changed

2 files changed

+7
-31
lines changed

features/frameworks/greentea-client/source/test_env.cpp

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,6 @@
2424
#include "greentea-client/greentea_metrics.h"
2525

2626

27-
#ifdef MBED_CFG_DEBUG_OPTIONS_COVERAGE
28-
extern "C" void __gcov_init(void);
29-
extern bool coverage_report;
30-
#endif
3127
/**
3228
* Generic test suite transport protocol keys
3329
*/
@@ -90,10 +86,6 @@ void GREENTEA_SETUP(const int timeout, const char *host_test_name) {
9086
greentea_notify_version();
9187
greentea_notify_timeout(timeout);
9288
greentea_notify_hosttest(host_test_name);
93-
#ifdef MBED_CFG_DEBUG_OPTIONS_COVERAGE
94-
//coverage_report = true;
95-
//__gcov_init();
96-
#endif
9789
}
9890

9991
/** \brief Notify host (__exit message) side that test suite execution was complete
@@ -137,9 +129,6 @@ void GREENTEA_TESTCASE_FINISH(const char *test_case_name, const size_t passes, c
137129
*/
138130
#ifdef MBED_CFG_DEBUG_OPTIONS_COVERAGE
139131
extern "C" void __gcov_flush(void);
140-
extern "C" void __gcov_init(void);
141-
extern "C" void gcov_exit(void);
142-
extern "C" int gcov_close(void);
143132
extern bool coverage_report;
144133

145134
/**
@@ -159,7 +148,6 @@ extern bool coverage_report;
159148
*
160149
*/
161150
void greentea_notify_coverage_start(const char *path) {
162-
printf("Starting coverage\n");
163151
printf("{{%s;%s;", GREENTEA_TEST_ENV_LCOV_START, path);
164152
}
165153

@@ -464,10 +452,8 @@ static void greentea_notify_hosttest(const char *host_test_name) {
464452
static void greentea_notify_completion(const int result) {
465453
const char *val = result ? GREENTEA_TEST_ENV_SUCCESS : GREENTEA_TEST_ENV_FAILURE;
466454
#ifdef MBED_CFG_DEBUG_OPTIONS_COVERAGE
467-
greentea_write_string("Calling __gcov_flush()\n");
468455
coverage_report = true;
469-
//__gcov_flush();
470-
gcov_exit();
456+
__gcov_flush();
471457
coverage_report = false;
472458
#endif
473459
greentea_metrics_report();

platform/retarget.cpp

Lines changed: 6 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,6 @@ extern "C" WEAK void mbed_sdk_init(void) {
162162
}
163163

164164
extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
165-
#if defined MBED_CFG_DEBUG_OPTIONS_COVERAGE
166-
if (coverage_report) {
167-
printf ("_open called!\n");
168-
}
169-
#endif
170165
#if defined(__MICROLIB) && (__ARMCC_VERSION>5030000)
171166
// Before version 5.03, we were using a patched version of microlib with proper names
172167
// This is the workaround that the microlib author suggested us
@@ -192,9 +187,8 @@ extern "C" FILEHANDLE PREFIX(_open)(const char* name, int openmode) {
192187
}
193188
#if defined MBED_CFG_DEBUG_OPTIONS_COVERAGE
194189
else if(coverage_report) {
195-
//init_serial();
196-
printf ("Calling greentea_notify_coverage_end()\n");
197-
//greentea_notify_coverage_start(name);
190+
init_serial();
191+
greentea_notify_coverage_start(name);
198192
return gcov_fd;
199193
}
200194
#endif
@@ -294,9 +288,8 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign
294288
#endif
295289
#endif
296290
n = length;
297-
}
298291
#if defined MBED_CFG_DEBUG_OPTIONS_COVERAGE
299-
else if (coverage_report && fh == gcov_fd){
292+
} else if (coverage_report && fh == gcov_fd){
300293
for (unsigned int i = 0; i < length; i++) {
301294
if (0 == buffer[i]){
302295
printf(".");
@@ -305,9 +298,8 @@ extern "C" int PREFIX(_write)(FILEHANDLE fh, const unsigned char *buffer, unsign
305298
}
306299
}
307300
n = length;
308-
}
309301
#endif
310-
else {
302+
} else {
311303
FileHandle* fhc = filehandles[fh-3];
312304
if (fhc == NULL) return -1;
313305

@@ -354,13 +346,11 @@ extern "C" int PREFIX(_read)(FILEHANDLE fh, unsigned char *buffer, unsigned int
354346
#endif
355347
#endif
356348
n = 1;
357-
}
358349
#if defined MBED_CFG_DEBUG_OPTIONS_COVERAGE
359-
else if (coverage_report && fh == gcov_fd){
350+
} else if (coverage_report && fh == gcov_fd){
360351
n = 0;
361-
}
362352
#endif
363-
else {
353+
} else {
364354
FileHandle* fhc = filehandles[fh-3];
365355
if (fhc == NULL) return -1;
366356

0 commit comments

Comments
 (0)