diff options
Diffstat (limited to 'archivers/libarchive/files/test_utils')
-rw-r--r-- | archivers/libarchive/files/test_utils/test_common.h | 3 | ||||
-rw-r--r-- | archivers/libarchive/files/test_utils/test_main.c | 17 |
2 files changed, 19 insertions, 1 deletions
diff --git a/archivers/libarchive/files/test_utils/test_common.h b/archivers/libarchive/files/test_utils/test_common.h index 1425dd84b7d..dd7e41016d5 100644 --- a/archivers/libarchive/files/test_utils/test_common.h +++ b/archivers/libarchive/files/test_utils/test_common.h @@ -329,6 +329,9 @@ int canLrzip(void); /* Return true if this platform can run the "lz4" program. */ int canLz4(void); +/* Return true if this platform can run the "zstd" program. */ +int canZstd(void); + /* Return true if this platform can run the "lzip" program. */ int canLzip(void); diff --git a/archivers/libarchive/files/test_utils/test_main.c b/archivers/libarchive/files/test_utils/test_main.c index 0e1413693f4..20ce551828c 100644 --- a/archivers/libarchive/files/test_utils/test_main.c +++ b/archivers/libarchive/files/test_utils/test_main.c @@ -2115,7 +2115,7 @@ void assertVersion(const char *prog, const char *base) int r; char *p, *q; size_t s; - unsigned int prog_len = strlen(base); + size_t prog_len = strlen(base); r = systemf("%s --version >version.stdout 2>version.stderr", prog); if (r != 0) @@ -2319,6 +2319,21 @@ canLz4(void) } /* + * Can this platform run the zstd program? + */ +int +canZstd(void) +{ + static int tested = 0, value = 0; + if (!tested) { + tested = 1; + if (systemf("zstd -V %s", redirectArgs) == 0) + value = 1; + } + return (value); +} + +/* * Can this platform run the lzip program? */ int |