Test: Fix text coloring not respecting default
Change-Id: I5d63b1d4c4d404c7293cecd279ac6101db26768f
Signed-off-by: Raef Coles <raef.coles@arm.com>
diff --git a/test/framework/test_framework.c b/test/framework/test_framework.c
index 4173f01..73bdbeb 100644
--- a/test/framework/test_framework.c
+++ b/test/framework/test_framework.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -115,7 +115,7 @@
return TEST_SUITE_ERR_INVALID_TEST_DATA;
}
- printf_set_color(WHITE);
+ printf_set_color(DEFAULT);
TEST_LOG("> Executing '%s' \r\n Description: '%s'\r\n",
p_test->name, p_test->desc);
diff --git a/test/framework/test_framework_helpers.c b/test/framework/test_framework_helpers.c
index 5341058..46f7171 100644
--- a/test/framework/test_framework_helpers.c
+++ b/test/framework/test_framework_helpers.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -36,5 +36,5 @@
void printf_set_color(enum serial_color_t color_id)
{
- TEST_LOG("\33[3%dm", color_id);
+ TEST_LOG("\33[%dm", color_id);
}
diff --git a/test/framework/test_framework_helpers.h b/test/framework/test_framework_helpers.h
index 6a99067..805a1b0 100644
--- a/test/framework/test_framework_helpers.h
+++ b/test/framework/test_framework_helpers.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2020, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -17,14 +17,15 @@
#endif
enum serial_color_t {
- BLACK = 0,
- RED = 1,
- GREEN = 2,
- YELLOW = 3,
- BLUE = 4,
- MAGENDA = 5,
- CYAN = 6,
- WHITE = 7,
+ DEFAULT = 0,
+ BLACK = 30,
+ RED = 31,
+ GREEN = 32,
+ YELLOW = 33,
+ BLUE = 34,
+ MAGENDA = 35,
+ CYAN = 36,
+ WHITE = 37,
};
/**
diff --git a/test/framework/test_framework_integ_test_helper.c b/test/framework/test_framework_integ_test_helper.c
index dc4ca01..3d0eefd 100644
--- a/test/framework/test_framework_integ_test_helper.c
+++ b/test/framework/test_framework_integ_test_helper.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2019, Arm Limited. All rights reserved.
+ * Copyright (c) 2017-2021, Arm Limited. All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*
@@ -33,7 +33,7 @@
printf_set_color(YELLOW);
TEST_LOG("\r\n*** %s test suites summary ***\r\n", suite_type);
for (i = 0; test_suites[i].freg != NULL; i++) {
- printf_set_color(WHITE);
+ printf_set_color(DEFAULT);
TEST_LOG("Test suite '%s' has", test_suites[i].name);
if (test_suites[i].val == TEST_PASSED) {
printf_set_color(GREEN);
@@ -47,5 +47,7 @@
printf_set_color(YELLOW);
TEST_LOG("\r\n*** End of %s test suites ***\r\n", suite_type);
+ printf_set_color(DEFAULT);
+
return retval;
}