Fix destdir usage for destdir != ./

Some more checks would be good, but this fixes basic usage for now.

Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
devs/tasn/jenkins
Daniel Willmann 10 years ago
parent 93ed31024e
commit feac36f368
  1. 19
      src/bin/exactness.c
  2. 14
      src/bin/run_test.c

@ -41,6 +41,7 @@ main(int argc, char *argv[])
List_Entry *test_list;
int args = 0;
const char *list_file = "";
char tmp[EXACTNESS_PATH_MAX];
Eina_Bool mode_record, mode_play, mode_init, mode_simulation;
Eina_Bool want_quit;
Ecore_Getopt_Value values[] = {
@ -121,12 +122,26 @@ main(int argc, char *argv[])
}
else if (mode_play)
{
mkdir(CURRENT_SUBDIR, 0744);
if (snprintf(tmp, EXACTNESS_PATH_MAX, "%s/%s", exactness_config.dest_dir, CURRENT_SUBDIR)
>= EXACTNESS_PATH_MAX)
{
fprintf(stderr, "Path too long: %s", tmp);
ret = 1;
goto end;
}
mkdir(tmp, 0744);
scheduler_run(run_test_play, test_list);
}
else if (mode_init)
{
mkdir(ORIG_SUBDIR, 0744);
if (snprintf(tmp, EXACTNESS_PATH_MAX, "%s/%s", exactness_config.dest_dir, ORIG_SUBDIR)
>= EXACTNESS_PATH_MAX)
{
fprintf(stderr, "Path too long: %s", tmp);
ret = 1;
goto end;
}
mkdir(tmp, 0744);
scheduler_run(run_test_init, test_list);
}
else if (mode_simulation)

@ -94,8 +94,8 @@ _compare_list_cb(const char *name, const char *path EINA_UNUSED, void *data)
if (!strncmp(name, prefix, strlen(prefix)))
{
char filename1[EXACTNESS_PATH_MAX], filename2[EXACTNESS_PATH_MAX];
snprintf(filename1, EXACTNESS_PATH_MAX, "%s/%s", CURRENT_SUBDIR, name);
snprintf(filename2, EXACTNESS_PATH_MAX, "%s/%s", ORIG_SUBDIR, name);
snprintf(filename1, EXACTNESS_PATH_MAX, "%s/%s/%s", exactness_config.dest_dir, CURRENT_SUBDIR, name);
snprintf(filename2, EXACTNESS_PATH_MAX, "%s/%s/%s", exactness_config.dest_dir, ORIG_SUBDIR, name);
if (!_md5_is_equal(filename1, filename2))
{
char buf[EXACTNESS_PATH_MAX];
@ -105,9 +105,9 @@ _compare_list_cb(const char *name, const char *path EINA_UNUSED, void *data)
/* FIXME: Clean up. */
snprintf(buf, EXACTNESS_PATH_MAX,
"compare '%s/%s' '%s/%s' '%s/comp_%s'",
ORIG_SUBDIR, name,
CURRENT_SUBDIR, name,
"compare '%s' '%s' '%s/%s/comp_%s'",
filename1, filename2,
exactness_config.dest_dir,
CURRENT_SUBDIR, name);
if (system(buf))
{
@ -120,7 +120,9 @@ _compare_list_cb(const char *name, const char *path EINA_UNUSED, void *data)
void
run_test_compare(const List_Entry *ent)
{
eina_file_dir_list(ORIG_SUBDIR, 0, _compare_list_cb, ent->name);
char origdir[EXACTNESS_PATH_MAX];
snprintf(origdir, EXACTNESS_PATH_MAX, "%s/%s", exactness_config.dest_dir, ORIG_SUBDIR);
eina_file_dir_list(origdir, 0, _compare_list_cb, ent->name);
}
static void

Loading…
Cancel
Save