selftests: futex: print testcase-name and PASS/FAIL/ERROR status

Most of the tests under selftests follow a pattern for their results,
which can then be parsed easily by other external tools easily. Though
futex tests do print the test results very well, it doesn't really
follow the general selftests pattern.

This patch makes necessary changes to fix that.

Output before this patch:
futex_requeue_pi: Test requeue functionality
        Arguments: broadcast=0 locked=0 owner=0 timeout=0ns
Result:  PASS

Output after this patch:
futex_requeue_pi: Test requeue functionality
        Arguments: broadcast=0 locked=0 owner=0 timeout=0ns
selftests: futex-requeue-pi [PASS]

Signed-off-by: Naresh Kamboju <naresh.kamboju@linaro.org>
Signed-off-by: Shuah Khan <shuahkh@osg.samsung.com>
This commit is contained in:
Naresh Kamboju
2017-05-22 12:47:43 +05:30
committed by Shuah Khan
parent 3c2993b8c6
commit 1f666e522c
8 changed files with 19 additions and 10 deletions

View File

@@ -107,7 +107,7 @@ void log_verbosity(int level)
*
* print_result() is primarily intended for functional tests.
*/
void print_result(int ret)
void print_result(const char *test_name, int ret)
{
const char *result = "Unknown return code";
@@ -124,7 +124,7 @@ void print_result(int ret)
result = FAIL;
break;
}
printf("Result: %s\n", result);
printf("selftests: %s [%s]\n", test_name, result);
}
/* log level macros */