61
61
62
62
int CASE_INDEX_START;
63
63
int CASE_INDEX_CURRENT;
64
+ bool CASE_IGNORED = false ;
64
65
65
66
using utest::v1::Case;
66
67
using utest::v1::Specification;
@@ -89,6 +90,7 @@ void test_restart_is_possible()
89
90
{
90
91
watchdog_features_t features = hal_watchdog_get_platform_features ();
91
92
if (!features.disable_watchdog ) {
93
+ CASE_IGNORED = true ;
92
94
TEST_IGNORE_MESSAGE (" Disabling watchdog not supported for this platform" );
93
95
return ;
94
96
}
@@ -100,6 +102,7 @@ void test_stop()
100
102
watchdog_features_t features = hal_watchdog_get_platform_features ();
101
103
if (!features.disable_watchdog ) {
102
104
TEST_ASSERT_EQUAL (WATCHDOG_STATUS_NOT_SUPPORTED, hal_watchdog_stop ());
105
+ CASE_IGNORED = true ;
103
106
TEST_IGNORE_MESSAGE (" Disabling watchdog not supported for this platform" );
104
107
return ;
105
108
}
@@ -118,6 +121,7 @@ void test_update_config()
118
121
{
119
122
watchdog_features_t features = hal_watchdog_get_platform_features ();
120
123
if (!features.update_config ) {
124
+ CASE_IGNORED = true ;
121
125
TEST_IGNORE_MESSAGE (" Updating watchdog config not supported for this platform" );
122
126
return ;
123
127
}
@@ -132,6 +136,7 @@ void test_update_config()
132
136
133
137
for (size_t i = 0 ; i < num_timeouts; i++) {
134
138
if (timeouts[i] < WDG_MIN_TIMEOUT_MS) {
139
+ CASE_IGNORED = true ;
135
140
TEST_IGNORE_MESSAGE (" Requested timeout value is too short -- ignoring test case." );
136
141
return ;
137
142
}
@@ -149,12 +154,16 @@ void test_update_config()
149
154
utest::v1::status_t case_setup_sync_on_reset (const Case *const source, const size_t index_of_case)
150
155
{
151
156
CASE_INDEX_CURRENT = index_of_case;
157
+ CASE_IGNORED = false ;
152
158
return utest::v1::greentea_case_setup_handler (source, index_of_case);
153
159
}
154
160
155
161
utest::v1::status_t case_teardown_sync_on_reset (const Case *const source, const size_t passed, const size_t failed,
156
162
const utest::v1::failure_t failure)
157
163
{
164
+ if (CASE_IGNORED) {
165
+ return utest::v1::greentea_case_teardown_handler (source, passed, failed, failure);
166
+ }
158
167
// Unlock kicking the watchdog during teardown.
159
168
kick_wdg_during_test_teardown.release ();
160
169
utest::v1::status_t status = utest::v1::greentea_case_teardown_handler (source, passed, failed, failure);
@@ -179,6 +188,9 @@ utest::v1::status_t case_teardown_sync_on_reset(const Case *const source, const
179
188
utest::v1::status_t case_teardown_wdg_stop_or_reset (const Case *const source, const size_t passed, const size_t failed,
180
189
const utest::v1::failure_t failure)
181
190
{
191
+ if (CASE_IGNORED) {
192
+ return utest::v1::greentea_case_teardown_handler (source, passed, failed, failure);
193
+ }
182
194
watchdog_features_t features = hal_watchdog_get_platform_features ();
183
195
if (features.disable_watchdog ) {
184
196
hal_watchdog_stop ();
@@ -192,6 +204,7 @@ template<uint32_t timeout_ms>
192
204
void test_init ()
193
205
{
194
206
if (timeout_ms < WDG_MIN_TIMEOUT_MS) {
207
+ CASE_IGNORED = true ;
195
208
TEST_IGNORE_MESSAGE (" Requested timeout value is too short -- ignoring test case." );
196
209
return ;
197
210
}
0 commit comments