Skip to content

Commit

Permalink
libperf tests: If a test fails return non-zero
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Jiri Olsa <[email protected]>
Cc: Alexander Shishkin <[email protected]>
Cc: Mark Rutland <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Stephane Eranian <[email protected]>
Link: http://lore.kernel.org/lkml/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
  • Loading branch information
captain5050 authored and acmel committed Jan 15, 2021
1 parent be82fdd commit bba2ea1
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tools/lib/perf/tests/test-cpumap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
2 changes: 1 addition & 1 deletion tools/lib/perf/tests/test-evlist.c
Original file line number Diff line number Diff line change
Expand Up @@ -409,5 +409,5 @@ int main(int argc, char **argv)
test_mmap_cpus();

__T_END;
return 0;
return tests_failed == 0 ? 0 : -1;
}
2 changes: 1 addition & 1 deletion tools/lib/perf/tests/test-evsel.c
Original file line number Diff line number Diff line change
Expand Up @@ -131,5 +131,5 @@ int main(int argc, char **argv)
test_stat_thread_enable();

__T_END;
return 0;
return tests_failed == 0 ? 0 : -1;
}
2 changes: 1 addition & 1 deletion tools/lib/perf/tests/test-threadmap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

0 comments on commit bba2ea1

Please sign in to comment.