]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Bail early if the program under test doesn't support -q at all.
authorTim Kientzle <kientzle@gmail.com>
Fri, 17 Jul 2009 04:23:58 +0000 (00:23 -0400)
committerTim Kientzle <kientzle@gmail.com>
Fri, 17 Jul 2009 04:23:58 +0000 (00:23 -0400)
SVN-Revision: 1230

tar/test/test_option_q.c

index b0979eb44bc31bd3892e25f2075c37f5ca9f8a19..6f576fb818dcd70107257d0c3440a0edbd23e93c 100644 (file)
@@ -28,6 +28,7 @@ __FBSDID("$FreeBSD: src/usr.bin/tar/test/test_option_q.c,v 1.3 2008/08/22 01:35:
 DEFINE_TEST(test_option_q)
 {
        FILE *f;
+       int r;
 
        /*
         * Create an archive with several different versions of the
@@ -82,9 +83,12 @@ DEFINE_TEST(test_option_q)
        /* Test 1: -q foo should only extract the first foo. */
        assertEqualInt(0, mkdir("test1", 0755));
        assertEqualInt(0, chdir("test1"));
-       assertEqualInt(0,
-           systemf("%s -xf ../archive.tar -q foo >test.out 2>test.err",
-               testprog));
+       r = systemf("%s -xf ../archive.tar -q foo >test.out 2>test.err",
+           testprog);
+       failure("Fatal error trying to use -q option");
+       if (!assertEqualInt(0, r))
+               return;
+
        assertFileContents("foo1", 4, "foo");
        assertEmptyFile("test.out");
        assertEmptyFile("test.err");