summaryrefslogtreecommitdiff
path: root/tar
diff options
context:
space:
mode:
authorMartin Matuska <martin@matuska.org>2019-04-07 01:54:42 +0200
committerMartin Matuska <martin@matuska.org>2019-04-07 02:38:54 +0200
commit9e1923e84d0803b27ae07e46f0d177cfbc52e0cb (patch)
tree7041c95f63341a5d0e0fc109feeac912e8bd0fd5 /tar
parenta221e3445b6a369dc7342ce7a44649e11a1619f0 (diff)
downloadlibarchive-9e1923e84d0803b27ae07e46f0d177cfbc52e0cb.tar.gz
Fix remaining MinGW tests
Enable tests on MinGW CI builds
Diffstat (limited to 'tar')
-rw-r--r--tar/test/test_option_C_mtree.c17
-rw-r--r--tar/test/test_strip_components.c3
2 files changed, 18 insertions, 2 deletions
diff --git a/tar/test/test_option_C_mtree.c b/tar/test/test_option_C_mtree.c
index caf8044b..f0903066 100644
--- a/tar/test/test_option_C_mtree.c
+++ b/tar/test/test_option_C_mtree.c
@@ -36,6 +36,9 @@ DEFINE_TEST(test_option_C_mtree)
p0 = NULL;
char *content = "./foo type=file uname=root gname=root mode=0755\n";
char *filename = "output.tar";
+#if defined(_WIN32) && !defined(CYGWIN)
+ char *p;
+#endif
/* an absolute path to mtree file */
char *mtree_file = "/METALOG.mtree";
@@ -48,9 +51,21 @@ DEFINE_TEST(test_option_C_mtree)
assertMakeDir("bar", 0775);
assertMakeFile("bar/foo", 0777, "abc");
- r = systemf("%s -cf %s -C bar \"@%s\" >step1.out 2>step1.err", testprog, filename, absolute_path);
+#if defined(_WIN32) && !defined(CYGWIN)
+ p = absolute_path;
+ while(*p != '\0') {
+ if (*p == '/')
+ *p = '\\';
+ p++;
+ }
+ r = systemf("%s -cf %s -C bar @%s >step1.out 2>step1.err", testprog, filename, absolute_path);
failure("Error invoking %s -cf %s -C bar @%s", testprog, filename, absolute_path);
+#else
+ r = systemf("%s -cf %s -C bar \"@%s\" >step1.out 2>step1.err", testprog, filename, absolute_path);
+ failure("Error invoking %s -cf %s -C bar \"@%s\"", testprog, filename, absolute_path);
+#endif
+
assertEqualInt(r, 0);
assertEmptyFile("step1.out");
assertEmptyFile("step1.err");
diff --git a/tar/test/test_strip_components.c b/tar/test/test_strip_components.c
index e1d71ddc..caf45a3e 100644
--- a/tar/test/test_strip_components.c
+++ b/tar/test/test_strip_components.c
@@ -64,9 +64,10 @@ DEFINE_TEST(test_strip_components)
failure("d0/d1/s2 is a symlink to something that won't be extracted");
/* If platform supports symlinks, target/s2 is a broken symlink. */
/* If platform does not support symlink, target/s2 doesn't exist. */
- assertFileNotExists("target/s2");
if (canSymlink())
assertIsSymlink("target/s2", "d2/f1");
+ else
+ assertFileNotExists("target/s2");
failure("d0/d1/d2 should be extracted");
assertIsDir("target/d2", -1);