File tree Expand file tree Collapse file tree 5 files changed +34
-3
lines changed
features/frameworks/mbed-trace Expand file tree Collapse file tree 5 files changed +34
-3
lines changed Original file line number Diff line number Diff line change @@ -169,6 +169,13 @@ yotta target x86-linux-native
169
169
yotta test mbed_trace_test
170
170
```
171
171
172
+ * In Mac
173
+
174
+ ```
175
+ yotta target x86-osx-native
176
+ yotta test mbed_trace_test
177
+ ```
178
+
172
179
* In Windows
173
180
174
181
```
Original file line number Diff line number Diff line change 27
27
"cpputest" : " ARMmbed/cpputest" ,
28
28
"nanostack-libservice" : " ^3.6.0"
29
29
},
30
+ "x86-osx-native" : {
31
+ "cpputest" : " ARMmbed/cpputest" ,
32
+ "nanostack-libservice" : " ^3.6.0"
33
+ },
30
34
"x86-windows-native" : {
31
35
"cpputest" : " ARMmbed/cpputest" ,
32
36
"nanostack-libservice" : " ^3.6.0"
Original file line number Diff line number Diff line change @@ -4,6 +4,12 @@ if(DEFINED TARGET_LIKE_X86_LINUX_NATIVE)
4
4
)
5
5
add_definitions ("-g -O0 -fprofile-arcs -ftest-coverage" )
6
6
target_link_libraries (mbed-trace gcov nanostack-libservice )
7
+ elseif (DEFINED TARGET_LIKE_X86_OSX_NATIVE )
8
+ add_library ( mbed-trace
9
+ mbed_trace.c
10
+ )
11
+ add_definitions ("-g -O0" )
12
+ target_link_libraries (mbed-trace nanostack-libservice )
7
13
else ()
8
14
add_library ( mbed-trace
9
15
mbed_trace.c
Original file line number Diff line number Diff line change 1
1
# only build tests on targets that declare they are like posix
2
- if (DEFINED TARGET_LIKE_X86_WINDOWS_NATIVE OR DEFINED TARGET_LIKE_X86_LINUX_NATIVE )
2
+ if (DEFINED TARGET_LIKE_X86_WINDOWS_NATIVE OR DEFINED TARGET_LIKE_X86_LINUX_NATIVE OR DEFINED TARGET_LIKE_X86_OSX_NATIVE )
3
3
4
4
# describe the test executable
5
5
add_executable (mbed_trace_test EXCLUDE_FROM_ALL Test .cpp stubs/ip6tos_stub.c )
@@ -13,10 +13,13 @@ if(DEFINED TARGET_LIKE_X86_WINDOWS_NATIVE OR DEFINED TARGET_LIKE_X86_LINUX_NATIV
13
13
if (DEFINED TARGET_LIKE_X86_WINDOWS_NATIVE )
14
14
add_test (mbed_trace_test "build/x86-windows-native/test/mbed_trace_test" )
15
15
add_dependencies (all_tests mbed_trace_test )
16
- endif ()
17
- if (DEFINED TARGET_LIKE_X86_LINUX_NATIVE )
16
+ elseif (DEFINED TARGET_LIKE_X86_LINUX_NATIVE )
18
17
SET (TEST_EXECUTABLE "../../../build/x86-linux-native/test/mbed_trace_test" )
19
18
add_test (mbed_trace_test ${TEST_EXECUTABLE} )
20
19
add_dependencies (all_tests mbed_trace_test )
20
+ elseif (DEFINED TARGET_LIKE_X86_OSX_NATIVE )
21
+ SET (TEST_EXECUTABLE "../../../build/x86-osx-native/test/mbed_trace_test" )
22
+ add_test (mbed_trace_test ${TEST_EXECUTABLE} )
23
+ add_dependencies (all_tests mbed_trace_test )
21
24
endif ()
22
25
endif ()
Original file line number Diff line number Diff line change @@ -454,6 +454,17 @@ TEST(trace, filters_control)
454
454
mbed_trace_exclude_filters_set (0 );
455
455
STRCMP_EQUAL (" " , mbed_trace_exclude_filters_get ());
456
456
}
457
+ TEST (trace, cmd_printer)
458
+ {
459
+ buf[0 ] = 0 ;
460
+ mbed_trace_config_set (TRACE_ACTIVE_LEVEL_ALL);
461
+ mbed_tracef (TRACE_LEVEL_CMD, " mygr" , " default printer" );
462
+ STRCMP_EQUAL (" default printer" , buf);
463
+
464
+ mbed_trace_cmdprint_function_set ( myprint );
465
+ mbed_tracef (TRACE_LEVEL_CMD, " mygr" , " custom printer" );
466
+ STRCMP_EQUAL (" \n " , buf); // because there is two print calls, second one add line feeds
467
+ }
457
468
TEST (trace, no_printer)
458
469
{
459
470
mbed_tracef (TRACE_LEVEL_DEBUG, " mygr" , " hello" );
You can’t perform that action at this time.
0 commit comments