summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSandrine Bailleux <sandrine.bailleux@arm.com>2017-06-22 16:17:48 +0100
committerSandrine Bailleux <sandrine.bailleux@arm.com>2018-01-23 10:51:04 +0100
commit5f1f6008b214c6b833c06fed9cdaa10a45ecd7ce (patch)
tree475fae907e2df61ac5a6bcd3aaa4daaeb5df1275
parent545817be60d1a6e8dc3366cbe7a25b22233f6311 (diff)
Increase user feedback
Add some traces to inform the user that a test is finished. Also print its result. Print the end of the test session. The final report will still summarize/repeat everything but the user now also gets this information as we go along. This is also useful for tests automation with LAVA. Change-Id: I8d3b1afd42da1a90d7c203c7deb1d59b18fe6375
-rw-r--r--framework/main.c9
-rw-r--r--framework/report.c2
-rw-r--r--include/lib/tftf_lib.h2
3 files changed, 11 insertions, 2 deletions
diff --git a/framework/main.c b/framework/main.c
index 5a032c7..580d2f3 100644
--- a/framework/main.c
+++ b/framework/main.c
@@ -271,10 +271,15 @@ static unsigned int close_test(void)
assert(tftf_get_ref_cnt() == 0);
/* Save test result in NVM */
+ test_result_t overall_test_result = get_overall_test_result();
tftf_testcase_set_result(current_testcase(),
- get_overall_test_result(),
+ overall_test_result,
0);
+ NOTICE("Unittest '%s - %s' complete. Result: %s\n",
+ current_testsuite()->name, current_testcase()->name,
+ test_result_to_string(overall_test_result));
+
/* The test is finished, let's move to the next one (if any) */
next_test = advance_to_next_test();
@@ -598,6 +603,8 @@ void __dead2 tftf_cold_boot_main(void)
void __dead2 tftf_exit(void)
{
+ NOTICE("Exiting tests.\n");
+
/* Let the platform code clean up if required */
tftf_platform_end();
diff --git a/framework/report.c b/framework/report.c
index 05d7a52..3eaed6d 100644
--- a/framework/report.c
+++ b/framework/report.c
@@ -74,7 +74,7 @@ static const char *test_result_strings[TEST_RESULT_MAX] = {
"Skipped", "Passed", "Failed", "Crashed",
};
-static const char *test_result_to_string(test_result_t result)
+const char *test_result_to_string(test_result_t result)
{
assert(TEST_RESULT_IS_VALID(result));
return test_result_strings[result];
diff --git a/include/lib/tftf_lib.h b/include/lib/tftf_lib.h
index 0ece4b9..54466ac 100644
--- a/include/lib/tftf_lib.h
+++ b/include/lib/tftf_lib.h
@@ -37,6 +37,8 @@ typedef enum {
TEST_RESULT_MAX
} test_result_t;
+const char *test_result_to_string(test_result_t result);
+
#define TEST_RESULT_IS_VALID(result) \
((result >= TEST_RESULT_MIN) && (result < TEST_RESULT_MAX))