]>
git.gir.st - tmk_keyboard.git/blob - tool/mbed/mbed-sdk/libraries/tests/mbed/env/test_env.h
10 // Const strings used in test_end
11 extern const char* TEST_ENV_START
;
12 extern const char* TEST_ENV_SUCCESS
;
13 extern const char* TEST_ENV_FAILURE
;
14 extern const char* TEST_ENV_MEASURE
;
15 extern const char* TEST_ENV_END
;
17 // Test result related notification functions
19 void notify_completion(bool success
);
20 bool notify_completion_str(bool success
, char* buffer
);
21 void notify_performance_coefficient(const char* measurement_name
, const int value
);
22 void notify_performance_coefficient(const char* measurement_name
, const unsigned int value
);
23 void notify_performance_coefficient(const char* measurement_name
, const double value
);
25 // Host test auto-detection API
26 void notify_host_test_name(const char *host_test
);
27 void notify_timeout(int timeout
);
28 void notify_test_id(const char *test_id
);
29 void notify_test_description(const char *description
);
31 // Host test auto-detection API
32 #define MBED_HOSTTEST_START(TESTID) notify_test_id(TESTID); notify_start()
33 #define MBED_HOSTTEST_SELECT(NAME) notify_host_test_name(#NAME)
34 #define MBED_HOSTTEST_TIMEOUT(SECONDS) notify_timeout(SECONDS)
35 #define MBED_HOSTTEST_DESCRIPTION(DESC) notify_test_description(#DESC)
36 #define MBED_HOSTTEST_RESULT(RESULT) notify_completion(RESULT)
39 Test auto-detection preamble example:
41 MBED_HOSTTEST_TIMEOUT(10);
42 MBED_HOSTTEST_SELECT( host_test );
43 MBED_HOSTTEST_DESCRIPTION(Hello World);
44 MBED_HOSTTEST_START("MBED_10");
45 // Proper 'host_test.py' should take over supervising of this test
50 MBED_HOSTTEST_RESULT(result);
55 // Test functionality useful during testing
56 unsigned int testenv_randseed();
58 // Macros, unit test like to provide basic comparisons
59 #define TESTENV_STRCMP(GIVEN,EXPECTED) (strcmp(GIVEN,EXPECTED) == 0)
61 // macros passed via test suite
62 #ifndef TEST_SUITE_TARGET_NAME
63 #define TEST_SUITE_TARGET_NAME "Unknown"
66 #ifndef TEST_SUITE_TEST_ID
67 #define TEST_SUITE_TEST_ID "Unknown"
70 #ifndef TEST_SUITE_UUID
71 #define TEST_SUITE_UUID "Unknown"