summaryrefslogtreecommitdiff
path: root/test_utils
diff options
context:
space:
mode:
authorSean Purcell <me@seanp.xyz>2017-04-20 11:59:10 -0700
committerSean Purcell <iburinoc@gmail.com>2017-05-15 23:06:48 -0400
commit0f6b9d7a7029eaaeb146cb770ec2f90dad3001dd (patch)
tree18a1ccba72cb670c91101c2e4eaba42755a82187 /test_utils
parentd38f66640aae194c3c055cb24774f00464d52b89 (diff)
downloadlibarchive-0f6b9d7a7029eaaeb146cb770ec2f90dad3001dd.tar.gz
Add zstd test suite
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/test_common.h3
-rw-r--r--test_utils/test_main.c15
2 files changed, 18 insertions, 0 deletions
diff --git a/test_utils/test_common.h b/test_utils/test_common.h
index 1425dd84..dd7e4101 100644
--- a/test_utils/test_common.h
+++ b/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/test_utils/test_main.c b/test_utils/test_main.c
index 0e141369..0e8cc9fc 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -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