Skip to content

Commit bba2ea1

Browse files
captain5050acmel
authored andcommitted
libperf tests: If a test fails return non-zero
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>
1 parent be82fdd commit bba2ea1

4 files changed

Lines changed: 4 additions & 4 deletions

File tree

tools/lib/perf/tests/test-cpumap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ int main(int argc, char **argv)
2727
perf_cpu_map__put(cpus);
2828

2929
__T_END;
30-
return 0;
30+
return tests_failed == 0 ? 0 : -1;
3131
}

tools/lib/perf/tests/test-evlist.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -409,5 +409,5 @@ int main(int argc, char **argv)
409409
test_mmap_cpus();
410410

411411
__T_END;
412-
return 0;
412+
return tests_failed == 0 ? 0 : -1;
413413
}

tools/lib/perf/tests/test-evsel.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,5 +131,5 @@ int main(int argc, char **argv)
131131
test_stat_thread_enable();
132132

133133
__T_END;
134-
return 0;
134+
return tests_failed == 0 ? 0 : -1;
135135
}

tools/lib/perf/tests/test-threadmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,5 @@ int main(int argc, char **argv)
2727
perf_thread_map__put(threads);
2828

2929
__T_END;
30-
return 0;
30+
return tests_failed == 0 ? 0 : -1;
3131
}

0 commit comments

Comments
 (0)