mirror of https://github.com/ARMmbed/mbed-os.git
Baremetal: Enable kernel_tick_count greentea test
parent
4b3cddff2a
commit
c91362fa3c
|
@ -14,10 +14,6 @@
|
||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
#if !defined(MBED_CONF_RTOS_PRESENT)
|
|
||||||
#error [NOT_SUPPORTED] kernel tick count test cases require a RTOS to run.
|
|
||||||
#else
|
|
||||||
|
|
||||||
#include "greentea-client/test_env.h"
|
#include "greentea-client/test_env.h"
|
||||||
#include "utest/utest.h"
|
#include "utest/utest.h"
|
||||||
#include "unity/unity.h"
|
#include "unity/unity.h"
|
||||||
|
@ -36,6 +32,7 @@ using utest::v1::Case;
|
||||||
#define SMALL_DELTA 1500 // 0.15%
|
#define SMALL_DELTA 1500 // 0.15%
|
||||||
#define BIG_DELTA 15000 // 1.5%
|
#define BIG_DELTA 15000 // 1.5%
|
||||||
|
|
||||||
|
#if defined(MBED_CONF_RTOS_PRESENT)
|
||||||
/** Test if kernel ticker frequency is 1kHz
|
/** Test if kernel ticker frequency is 1kHz
|
||||||
|
|
||||||
Given a RTOS kernel ticker
|
Given a RTOS kernel ticker
|
||||||
|
@ -47,6 +44,7 @@ void test_frequency()
|
||||||
uint32_t freq = osKernelGetTickFreq();
|
uint32_t freq = osKernelGetTickFreq();
|
||||||
TEST_ASSERT_EQUAL_UINT32_MESSAGE(1000, freq, "Expected SysTick frequency is 1kHz");
|
TEST_ASSERT_EQUAL_UINT32_MESSAGE(1000, freq, "Expected SysTick frequency is 1kHz");
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/** Test if kernel ticker increments by one
|
/** Test if kernel ticker increments by one
|
||||||
|
|
||||||
|
@ -105,7 +103,9 @@ void test_interval()
|
||||||
|
|
||||||
// Test cases
|
// Test cases
|
||||||
Case cases[] = {
|
Case cases[] = {
|
||||||
|
#if defined(MBED_CONF_RTOS_PRESENT)
|
||||||
Case("Test kernel ticker frequency", test_frequency),
|
Case("Test kernel ticker frequency", test_frequency),
|
||||||
|
#endif
|
||||||
Case("Test if kernel ticker increments by one", test_increment),
|
Case("Test if kernel ticker increments by one", test_increment),
|
||||||
Case("Test if kernel ticker interval is 1ms", test_interval)
|
Case("Test if kernel ticker interval is 1ms", test_interval)
|
||||||
};
|
};
|
||||||
|
@ -122,4 +122,3 @@ int main()
|
||||||
{
|
{
|
||||||
return !utest::v1::Harness::run(specification);
|
return !utest::v1::Harness::run(specification);
|
||||||
}
|
}
|
||||||
#endif // !defined(MBED_CONF_RTOS_PRESENT)
|
|
||||||
|
|
Loading…
Reference in New Issue