301a89f8cf
Keep the count of failed tests, so we get better output with failures, like: # make tests ... running static: - running test-cpumap.c...OK - running test-threadmap.c...OK - running test-evlist.c...FAILED test-evlist.c:53 failed to create evsel2 FAILED test-evlist.c:163 failed to create evsel2 FAILED test-evlist.c:287 failed count FAILED (3) - running test-evsel.c...OK running dynamic: - running test-cpumap.c...OK - running test-threadmap.c...OK - running test-evlist.c...FAILED test-evlist.c:53 failed to create evsel2 FAILED test-evlist.c:163 failed to create evsel2 FAILED test-evlist.c:287 failed count FAILED (3) - running test-evsel.c...OK ... Signed-off-by: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Alexey Budankov <alexey.budankov@linux.intel.com> Cc: Andi Kleen <ak@linux.intel.com> Cc: Jin Yao <yao.jin@linux.intel.com> Cc: Michael Petlan <mpetlan@redhat.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/20191017105918.20873-9-jolsa@kernel.org Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
32 lines
565 B
C
32 lines
565 B
C
// SPDX-License-Identifier: GPL-2.0
|
|
#include <stdarg.h>
|
|
#include <stdio.h>
|
|
#include <perf/threadmap.h>
|
|
#include <internal/tests.h>
|
|
|
|
static int libperf_print(enum libperf_print_level level,
|
|
const char *fmt, va_list ap)
|
|
{
|
|
return vfprintf(stderr, fmt, ap);
|
|
}
|
|
|
|
int main(int argc, char **argv)
|
|
{
|
|
struct perf_thread_map *threads;
|
|
|
|
__T_START;
|
|
|
|
libperf_init(libperf_print);
|
|
|
|
threads = perf_thread_map__new_dummy();
|
|
if (!threads)
|
|
return -1;
|
|
|
|
perf_thread_map__get(threads);
|
|
perf_thread_map__put(threads);
|
|
perf_thread_map__put(threads);
|
|
|
|
__T_END;
|
|
return 0;
|
|
}
|