libperf tests: If a test fails return non-zero

[ Upstream commit bba2ea17ef553aea0df80cb64399fe2f70f225dd ]

If a test fails return -1 rather than 0. This is consistent with the
return value in test-cpumap.c

Signed-off-by: Ian Rogers <irogers@google.com>
Acked-by: Jiri Olsa <jolsa@redhat.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Stephane Eranian <eranian@google.com>
Link: http://lore.kernel.org/lkml/20210114180250.3853825-1-irogers@google.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Ian Rogers 2021-01-14 10:02:49 -08:00 committed by Greg Kroah-Hartman
parent 2ca824c793
commit 680559480c
4 changed files with 4 additions and 4 deletions

View File

@ -27,5 +27,5 @@ int main(int argc, char **argv)
perf_cpu_map__put(cpus);
__T_END;
return 0;
return tests_failed == 0 ? 0 : -1;
}

View File

@ -409,5 +409,5 @@ int main(int argc, char **argv)
test_mmap_cpus();
__T_END;
return 0;
return tests_failed == 0 ? 0 : -1;
}

View File

@ -131,5 +131,5 @@ int main(int argc, char **argv)
test_stat_thread_enable();
__T_END;
return 0;
return tests_failed == 0 ? 0 : -1;
}

View File

@ -27,5 +27,5 @@ int main(int argc, char **argv)
perf_thread_map__put(threads);
__T_END;
return 0;
return tests_failed == 0 ? 0 : -1;
}