]> git.ipfire.org Git - thirdparty/libarchive.git/commitdiff
Really sync up the test harnesses
authorTim Kientzle <kientzle@gmail.com>
Fri, 29 Jan 2016 05:33:53 +0000 (21:33 -0800)
committerTim Kientzle <kientzle@gmail.com>
Fri, 29 Jan 2016 05:33:53 +0000 (21:33 -0800)
cat/test/test.h
cpio/test/test.h
libarchive/test/test.h
tar/test/test.h

index 89b593108c20410a320a536f9410ddd6f183f70a..78f96792c9e93056cf3f6cedffa1734852cbef75 100644 (file)
@@ -278,6 +278,9 @@ int canGrzip(void);
 /* Return true if this platform can run the "gzip" program. */
 int canGzip(void);
 
+/* Return true if this platform can run the specified command. */
+int canRunCommand(const char *);
+
 /* Return true if this platform can run the "lrzip" program. */
 int canLrzip(void);
 
@@ -306,11 +309,19 @@ int is_LargeInode(const char *);
 /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
 char *slurpfile(size_t *, const char *fmt, ...);
 
+/* Dump block of bytes to a file. */
+void dumpfile(const char *filename, void *, size_t);
+
 /* Extracts named reference file to the current directory. */
 void extract_reference_file(const char *);
 /* Copies named reference file to the current directory. */
 void copy_reference_file(const char *);
 
+/* Extracts a list of files to the current directory.
+ * List must be NULL terminated.
+ */
+void extract_reference_files(const char **);
+
 /* Path to working directory for current test */
 extern const char *testworkdir;
 
index 5a39c686c67e467c22b24191d409c52da5a62377..0cd3e904087dc9204263c09048aac9d14c8a92d2 100644 (file)
@@ -85,6 +85,8 @@
 /* Windows (including Visual Studio and MinGW but not Cygwin) */
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #if !defined(__BORLANDC__)
+#undef chdir
+#define chdir _chdir
 #define strdup _strdup
 #endif
 #endif
@@ -276,6 +278,9 @@ int canGrzip(void);
 /* Return true if this platform can run the "gzip" program. */
 int canGzip(void);
 
+/* Return true if this platform can run the specified command. */
+int canRunCommand(const char *);
+
 /* Return true if this platform can run the "lrzip" program. */
 int canLrzip(void);
 
@@ -304,11 +309,19 @@ int is_LargeInode(const char *);
 /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
 char *slurpfile(size_t *, const char *fmt, ...);
 
+/* Dump block of bytes to a file. */
+void dumpfile(const char *filename, void *, size_t);
+
 /* Extracts named reference file to the current directory. */
 void extract_reference_file(const char *);
 /* Copies named reference file to the current directory. */
 void copy_reference_file(const char *);
 
+/* Extracts a list of files to the current directory.
+ * List must be NULL terminated.
+ */
+void extract_reference_files(const char **);
+
 /* Path to working directory for current test */
 extern const char *testworkdir;
 
index bde7c1d77ad1c4def430fe7cf2ebaeddb1da8e53..ad3de27ba7693081b057bb11b08a4d35d51962e3 100644 (file)
@@ -66,6 +66,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <ctype.h>
 #include <time.h>
 #ifdef HAVE_UNISTD_H
 #include <unistd.h>
@@ -84,6 +85,8 @@
 /* Windows (including Visual Studio and MinGW but not Cygwin) */
 #if defined(_WIN32) && !defined(__CYGWIN__)
 #if !defined(__BORLANDC__)
+#undef chdir
+#define chdir _chdir
 #define strdup _strdup
 #endif
 #endif
   assertion_make_hardlink(__FILE__, __LINE__, newfile, oldfile)
 #define assertMakeSymlink(newfile, linkto)     \
   assertion_make_symlink(__FILE__, __LINE__, newfile, linkto)
-#define assertNodump(path)     \
+#define assertNodump(path)      \
   assertion_nodump(__FILE__, __LINE__, path)
 #define assertUmask(mask)      \
   assertion_umask(__FILE__, __LINE__, mask)
index 89b593108c20410a320a536f9410ddd6f183f70a..78f96792c9e93056cf3f6cedffa1734852cbef75 100644 (file)
@@ -278,6 +278,9 @@ int canGrzip(void);
 /* Return true if this platform can run the "gzip" program. */
 int canGzip(void);
 
+/* Return true if this platform can run the specified command. */
+int canRunCommand(const char *);
+
 /* Return true if this platform can run the "lrzip" program. */
 int canLrzip(void);
 
@@ -306,11 +309,19 @@ int is_LargeInode(const char *);
 /* Supports printf-style args: slurpfile(NULL, "%s/myfile", refdir); */
 char *slurpfile(size_t *, const char *fmt, ...);
 
+/* Dump block of bytes to a file. */
+void dumpfile(const char *filename, void *, size_t);
+
 /* Extracts named reference file to the current directory. */
 void extract_reference_file(const char *);
 /* Copies named reference file to the current directory. */
 void copy_reference_file(const char *);
 
+/* Extracts a list of files to the current directory.
+ * List must be NULL terminated.
+ */
+void extract_reference_files(const char **);
+
 /* Path to working directory for current test */
 extern const char *testworkdir;