summaryrefslogtreecommitdiff
path: root/test_utils
diff options
context:
space:
mode:
authorzoulasc <christos@zoulas.com>2020-01-16 15:29:57 -0500
committerzoulasc <christos@zoulas.com>2020-01-16 15:29:57 -0500
commit7e2c2798351eaea10eaf9ebf6857a8dbd245a162 (patch)
tree4d066e6d68b37b26e0a266a12446991b34b0175a /test_utils
parent0bf726cfec99b0f03791a028d44493b19f5bf61b (diff)
downloadlibarchive-7e2c2798351eaea10eaf9ebf6857a8dbd245a162.tar.gz
- Add the NetBSD-specific config.h
- Use --help instead of -V when -V exits with non-zero code - Double the string size to prevent truncation
Diffstat (limited to 'test_utils')
-rw-r--r--test_utils/test_common.h3
-rw-r--r--test_utils/test_main.c20
2 files changed, 13 insertions, 10 deletions
diff --git a/test_utils/test_common.h b/test_utils/test_common.h
index e12c152c..66047320 100644
--- a/test_utils/test_common.h
+++ b/test_utils/test_common.h
@@ -38,6 +38,9 @@
#elif defined(__FreeBSD__)
/* Building as part of FreeBSD system requires a pre-built config.h. */
#include "config_freebsd.h"
+#elif defined(__NetBSD__)
+/* Building as part of NetBSD system requires a pre-built config.h. */
+#include "config_netbsd.h"
#elif defined(_WIN32) && !defined(__CYGWIN__)
/* Win32 can't run the 'configure' script. */
#include "config_windows.h"
diff --git a/test_utils/test_main.c b/test_utils/test_main.c
index 1b44edf1..c34c0249 100644
--- a/test_utils/test_main.c
+++ b/test_utils/test_main.c
@@ -2480,7 +2480,7 @@ canBzip2(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("bzip2 -d -V %s", redirectArgs) == 0)
+ if (systemf("bzip2 --help %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -2510,7 +2510,7 @@ canGzip(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("gzip -V %s", redirectArgs) == 0)
+ if (systemf("gzip --help %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -2552,7 +2552,7 @@ canLz4(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("lz4 -V %s", redirectArgs) == 0)
+ if (systemf("lz4 --help %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -2567,7 +2567,7 @@ canZstd(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("zstd -V %s", redirectArgs) == 0)
+ if (systemf("zstd --help %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -2582,7 +2582,7 @@ canLzip(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("lzip -V %s", redirectArgs) == 0)
+ if (systemf("lzip --help %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -2597,7 +2597,7 @@ canLzma(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("lzma -V %s", redirectArgs) == 0)
+ if (systemf("lzma %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -2612,7 +2612,7 @@ canLzop(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("lzop -V %s", redirectArgs) == 0)
+ if (systemf("lzop --help %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -2627,7 +2627,7 @@ canXz(void)
static int tested = 0, value = 0;
if (!tested) {
tested = 1;
- if (systemf("xz -V %s", redirectArgs) == 0)
+ if (systemf("xz --help %s", redirectArgs) == 0)
value = 1;
}
return (value);
@@ -3499,9 +3499,9 @@ static int
test_run(int i, const char *tmpdir)
{
#ifdef PATH_MAX
- char workdir[PATH_MAX];
+ char workdir[PATH_MAX * 2];
#else
- char workdir[1024];
+ char workdir[1024 * 2];
#endif
char logfilename[64];
int failures_before = failures;