mirror of
https://github.com/lkl/linux.git
synced 2025-12-19 08:03:01 +09:00
lkl: tests: minor lkl_test_kasan changes
Grep for the kunit kasan group summary so that we can log the test + fail count. Use a common exit path to ensure log is always freed. Signed-off-by: David Disseldorp <ddiss@suse.de>
This commit is contained in:
@@ -563,22 +563,26 @@ static int lkl_test_kasan(void)
|
||||
{
|
||||
char *log = strdup(boot_log);
|
||||
char *line = NULL;
|
||||
char c, d;
|
||||
int p, f, s, t;
|
||||
int num_lines, result = TEST_FAILURE;
|
||||
|
||||
line = strtok(log, "\n");
|
||||
while (line) {
|
||||
if (sscanf(line, "[ %*f] ok %*d kasa%c%c", &c, &d) == 1 &&
|
||||
c == 'n') {
|
||||
for (num_lines = 0; line; num_lines++) {
|
||||
if (sscanf(line,
|
||||
"[ %*f] # kasan: pass:%d fail:%d skip:%d total:%d",
|
||||
&p, &f, &s, &t) == 4) {
|
||||
lkl_test_logf("%s", line);
|
||||
return TEST_SUCCESS;
|
||||
result = (f == 0 ? TEST_SUCCESS : TEST_FAILURE);
|
||||
goto out;
|
||||
}
|
||||
|
||||
line = strtok(NULL, "\n");
|
||||
}
|
||||
|
||||
lkl_test_logf("no kasan test output in %d log lines\n", num_lines);
|
||||
out:
|
||||
free(log);
|
||||
|
||||
return TEST_FAILURE;
|
||||
return result;
|
||||
}
|
||||
#else
|
||||
#define KASAN_CMD_LINE
|
||||
|
||||
Reference in New Issue
Block a user