}
if (!strcmp (subname, "extras")) {
// Only load "extras" dirs if explicitly specified
- R_LOG_WARN ("Skipping %s" R_SYS_DIR "%s because it requires additional dependencies", path, subname);
+ R_LOG_WARN ("Skipping %s" R_SYS_DIR "%s because it requires additional dependencies", shortpath (path), subname);
continue;
}
#if WANT_V35 == 0
size_t i = 0;
for (; i < sizeof (v35_tests_to_skip) / sizeof (R2RTestToSkip); i++) {
R2RTestToSkip test = v35_tests_to_skip[i];
- bool is_dir = r_str_endswith (path, r_str_newf (R_SYS_DIR "%s", test.dir));
+ char *testdir = r_str_newf (R_SYS_DIR "%s", test.dir);
+ bool is_dir = r_str_endswith (path, testdir);
+ free (testdir);
if (is_dir) {
if (!strcmp (subname, test.name)) {
- R_LOG_WARN ("Skipping test %s" R_SYS_DIR "%s because it requires arm.v35", path, subname);
+ R_LOG_WARN ("Skipping test %s" R_SYS_DIR "%s because it requires arm.v35", shortpath (path), subname);
skip = true;
break;
}
}
#endif
if (skip_asm && test_from.type == R2R_TEST_TYPE_ASM) {
- R_LOG_INFO ("R2R_SKIP_ASM: Skipping %s", path);
+ R_LOG_INFO ("R2R_SKIP_ASM: Skipping %s", shortpath (path));
continue;
}
if (test_from.archos && (skip_archos || strcmp (subname, archos))) {
- R_LOG_INFO ("Skipping %s" R_SYS_DIR "%s because it does not match the current platform \"%s\"", path, subname, archos);
+ R_LOG_INFO ("Skipping %s" R_SYS_DIR "%s because it does not match the current platform \"%s\"", shortpath (path), subname, archos);
continue;
}
char *subpath = r_file_new (path, subname, NULL);
RVecR2RTestResultInfoPtr_fini (vec);
}
-static const char *shortpath (const char *testpath) {
- char *shorter = strstr (testpath, "/db/");
- if (shorter) {
- return shorter + 1;
- }
- return testpath;
-}
-
static void parse_skip(const char *arg) {
if (strstr (arg, "arch")) {
r_sys_setenv ("R2R_SKIP_ARCHOS", "1");
R_LOG_INFO ("R2R_RADARE2: %s", state->run_config.r2_cmd);
R_LOG_INFO ("R2R_RASM2: %s", state->run_config.rasm2_cmd);
if (r_sys_cmdf ("%s -v", state->run_config.r2_cmd) != 0) {
- R_LOG_ERROR ("Failed to run r2 -v");
- return false;
+ if (r_sys_cmdf ("%s -v", state->run_config.r2_cmd) != 0) {
+ R_LOG_ERROR ("Failed to run r2 -v");
+ return false;
+ }
}
printf ("%s-%d r2r\n", R2_GITTAP, R2_ABIVERSION);
// TODO: check if r2r binary version is the same as the r2/rasm2 ones
if (r_sys_cmdf ("%s -V", state->run_config.r2_cmd) != 0) {
R_LOG_ERROR ("Inconsistent versions of r2 and its libraries");
- return false;
+ r_sys_sleep (3);
+ // return false;
}
return true;
}
};
} R2RTestResultInfo;
+static inline const char *shortpath (const char *testpath) {
+ char *shorter = strstr (testpath, "/db/");
+ if (shorter) {
+ return shorter + 1;
+ }
+ shorter = strstr (testpath, "/bins/fuzzed");
+ if (shorter) {
+ return shorter + 6;
+ }
+ return testpath;
+}
+
+
R_API R2RCmdTest *r2r_cmd_test_new(void);
R_API void r2r_cmd_test_free(R2RCmdTest *test);
R_API RVecR2RCmdTestPtr *r2r_load_cmd_test_file(const char *file);