mirror of
https://github.com/troglobit/libite.git
synced 2026-11-10 16:31:15 +00:00
rsync.test: Use homegrown tree, instead of out-of-tree tree ...
Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
1 parent
1f1e88a640
commit
42b6a03317
2 files changed
+11
-13
No files matched your search
@@ -241,7 +241,7 @@ void setup_test(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void tree(char *heading, char *dir)
|
static void check_tree(char *heading, char *dir)
|
||||||
{
|
{
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
char cmd[128];
|
char cmd[128];
|
||||||
@@ -249,9 +249,7 @@ static void tree(char *heading, char *dir)
|
|||||||
if (heading)
|
if (heading)
|
||||||
puts(heading);
|
puts(heading);
|
||||||
|
|
||||||
snprintf(cmd, sizeof(cmd), "tree -np %s", dir);
|
tree(dir, 1);
|
||||||
if (system(cmd))
|
|
||||||
perror("Failed calling tree, not installed perhaps");
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -261,34 +259,34 @@ int run_test(void)
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
setup_test();
|
setup_test();
|
||||||
tree("Before:", BASE);
|
check_tree("Before:", BASE);
|
||||||
|
|
||||||
result += rsync(SRC, DST, 0, NULL);
|
result += rsync(SRC, DST, 0, NULL);
|
||||||
tree("After:", BASE);
|
check_tree("After:", BASE);
|
||||||
cleanup_test();
|
cleanup_test();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
setup_test();
|
setup_test();
|
||||||
result += rsync(BASE "src", DST, 0, NULL);
|
result += rsync(BASE "src", DST, 0, NULL);
|
||||||
tree("Only partial rsync of src <-- No slash!", BASE);
|
check_tree("Only partial rsync of src <-- No slash!", BASE);
|
||||||
#if 0
|
#if 0
|
||||||
cleanup_test();
|
cleanup_test();
|
||||||
setup_test();
|
setup_test();
|
||||||
result += rsync(BASE "src/sub1", BASE "dst", 0, NULL);
|
result += rsync(BASE "src/sub1", BASE "dst", 0, NULL);
|
||||||
tree("Only partial rsync of src/sub1 <-- No slashes!!", BASE);
|
check_tree("Only partial rsync of src/sub1 <-- No slashes!!", BASE);
|
||||||
|
|
||||||
cleanup_test();
|
cleanup_test();
|
||||||
setup_test();
|
setup_test();
|
||||||
result += rsync(BASE "src/sub1/", DST, 0, NULL);
|
result += rsync(BASE "src/sub1/", DST, 0, NULL);
|
||||||
tree("Only partial rsync of src/sub1/", BASE);
|
check_tree("Only partial rsync of src/sub1/", BASE);
|
||||||
|
|
||||||
cleanup_test();
|
cleanup_test();
|
||||||
setup_test();
|
setup_test();
|
||||||
result += rsync(BASE "src/sub1", DST, 0, NULL);
|
result += rsync(BASE "src/sub1", DST, 0, NULL);
|
||||||
tree("Only partial rsync of src/sub1 <-- No slash!", BASE);
|
check_tree("Only partial rsync of src/sub1 <-- No slash!", BASE);
|
||||||
|
|
||||||
result += rsync("/etc", "/var/tmp", 0, NULL);
|
result += rsync("/etc", "/var/tmp", 0, NULL);
|
||||||
tree("Real life test:", "/var/tmp");
|
check_tree("Real life test:", "/var/tmp");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Reference in new issue
Block a user