summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/builtin-test.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/builtin-test.c')
-rw-r--r--tools/perf/tests/builtin-test.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/tools/perf/tests/builtin-test.c b/tools/perf/tests/builtin-test.c
index d336cda94a11..81cf241cd109 100644
--- a/tools/perf/tests/builtin-test.c
+++ b/tools/perf/tests/builtin-test.c
@@ -137,10 +137,10 @@ static bool has_subtests(const struct test_suite *t)
static const char *skip_reason(const struct test_suite *t, int subtest)
{
- if (t->test_cases && subtest >= 0)
- return t->test_cases[subtest].skip_reason;
+ if (!t->test_cases)
+ return NULL;
- return NULL;
+ return t->test_cases[subtest >= 0 ? subtest : 0].skip_reason;
}
static const char *test_description(const struct test_suite *t, int subtest)
@@ -299,7 +299,9 @@ static const char *shell_test__description(char *description, size_t size,
#define for_each_shell_test(entlist, nr, base, ent) \
for (int __i = 0; __i < nr && (ent = entlist[__i]); __i++) \
- if (!is_directory(base, ent) && ent->d_name[0] != '.')
+ if (!is_directory(base, ent) && \
+ is_executable_file(base, ent) && \
+ ent->d_name[0] != '.')
static const char *shell_tests__dir(char *path, size_t size)
{