File tree Expand file tree Collapse file tree 12 files changed +68
-31
lines changed Expand file tree Collapse file tree 12 files changed +68
-31
lines changed Original file line number Diff line number Diff line change 17
17
*/
18
18
19
19
#include " utest/case.h"
20
+ #include " utest/utest_serial.h"
20
21
21
22
using namespace utest ::v1;
22
23
Original file line number Diff line number Diff line change 19
19
#include " utest/default_handlers.h"
20
20
#include " utest/case.h"
21
21
#include " utest/stack_trace.h"
22
-
22
+ # include " utest/utest_serial.h "
23
23
24
24
using namespace utest ::v1;
25
25
Original file line number Diff line number Diff line change 20
20
#include " utest/case.h"
21
21
#include " greentea-client/test_env.h"
22
22
#include " utest/stack_trace.h"
23
+ #include " utest/utest_serial.h"
23
24
24
25
using namespace utest ::v1;
25
26
@@ -56,7 +57,7 @@ const handlers_t utest::v1::selftest_handlers = {
56
57
};
57
58
58
59
59
- // --- SPECIAL HANDLERS ---
60
+ // --- SPECIAL HANDLERS ---
60
61
static utest::v1::status_t unknown_test_setup_handler (const size_t ) {
61
62
UTEST_LOG_FUNCTION ();
62
63
utest_printf (" >>> I do not know how to tell greentea that the test started, since\n " );
Original file line number Diff line number Diff line change 18
18
19
19
#include " utest/harness.h"
20
20
#include " utest/stack_trace.h"
21
+ #include " utest/utest_serial.h"
21
22
22
23
#include < stdlib.h>
23
24
Original file line number Diff line number Diff line change @@ -124,20 +124,6 @@ static int32_t utest_us_ticker_run()
124
124
return 0 ;
125
125
}
126
126
127
- int utest_printf (char *str, ...)
128
- {
129
- volatile uint32_t primask = __get_PRIMASK ();\
130
- if ( (primask & 0x1 ) == 0 ){ \
131
- va_list vargs;
132
-
133
- va_start (vargs, str);
134
- vprintf (str, vargs);
135
- va_end (vargs);
136
- }
137
-
138
- return 0 ;
139
- }
140
-
141
127
142
128
extern " C" {
143
129
static const utest_v1_scheduler_t utest_v1_scheduler =
Original file line number Diff line number Diff line change 21
21
#include " utest.h"
22
22
#include " unity.h"
23
23
#include " utest/stack_trace.h"
24
-
25
- #include < stdio.h>
24
+ #include " utest/utest_serial.h"
26
25
27
26
using namespace utest ::v1;
28
27
Original file line number Diff line number Diff line change 16
16
****************************************************************************
17
17
*/
18
18
19
- #include " utest/harness.h"
20
- #include " utest/stack_trace.h"
21
- #include " utest/unity_handler.h"
22
-
19
+ #include " utest/harness.h"
20
+ #include " utest/stack_trace.h"
21
+ #include " utest/unity_handler.h"
22
+ # include " utest/utest_serial.h "
23
23
24
24
void utest_unity_assert_failure (void )
25
25
{
@@ -35,11 +35,7 @@ void utest_unity_ignore_failure(void)
35
35
36
36
void utest_safe_putc (int chr)
37
37
{
38
- volatile uint32_t primask = __get_PRIMASK ();
39
- if ( (primask & 0x1 ) == 0 ){
40
- (void )putchar (chr);
41
- }
42
-
38
+ utest_serial.putc (chr);
43
39
}
44
40
45
41
Original file line number Diff line number Diff line change
1
+ /* ***************************************************************************
2
+ * Copyright (c) 2015, ARM Limited, All Rights Reserved
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+ * not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ ****************************************************************************
17
+ */
18
+
19
+ #include " utest/utest_serial.h"
20
+
21
+ RawSerial utest_serial (USBTX, USBRX);
22
+
23
+ void utest_safe_putc (int chr)
24
+ {
25
+ utest_serial.putc (chr);
26
+ }
27
+
28
+
Original file line number Diff line number Diff line change @@ -76,7 +76,6 @@ extern "C" {
76
76
/// must be implemented by the port
77
77
void utest_v1_enter_critical_section (void );
78
78
void utest_v1_leave_critical_section (void );
79
- int utest_printf (char * str , ...);
80
79
81
80
/// This is the default scheduler implementation used by the harness.
82
81
utest_v1_scheduler_t utest_v1_get_scheduler (void );
Original file line number Diff line number Diff line change 20
20
#define UTEST_UNITY_ASSERT_FAILURE_H
21
21
22
22
#include <stdint.h>
23
- #include <stdio.h>
24
- #include "cmsis.h"
25
23
26
24
#ifdef __cplusplus
27
25
extern "C" {
Original file line number Diff line number Diff line change 23
23
#include "case.h"
24
24
#include "default_handlers.h"
25
25
#include "harness.h"
26
-
26
+ #include "utest/utest_serial.h"
27
27
28
28
#endif // UTEST_H
Original file line number Diff line number Diff line change
1
+ /****************************************************************************
2
+ * Copyright (c) 2016, ARM Limited, All Rights Reserved
3
+ * SPDX-License-Identifier: Apache-2.0
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License"); you may
6
+ * not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
13
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ ****************************************************************************
17
+ */
18
+
19
+ #ifndef UTEST_SERIAL_H
20
+ #define UTEST_SERIAL_H
21
+
22
+ #include "mbed.h"
23
+
24
+ extern RawSerial utest_serial ;
25
+
26
+ #define utest_printf (...) utest_serial.printf(__VA_ARGS__)
27
+
28
+ #endif // UTEST_SERIAL_H
You can’t perform that action at this time.
0 commit comments