New module attribute 'Applicability'.
[gnulib.git] / tests / test-link.c
index 255a939..dd7df2e 100644 (file)
 
 #include <unistd.h>
 
+#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
 #include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #define ASSERT(expr) \
   do                                                                         \
     }                                                                        \
   while (0)
 
+#define BASE "test-link.t"
+
+#include "test-link.h"
+
 int
-main (int argc, char **argv)
+main (void)
 {
-  ASSERT (argc == 3);
-  ASSERT (link (argv[1], argv[2]) == 0);
+  /* Remove any garbage left from previous partial runs.  */
+  ASSERT (system ("rm -rf " BASE "*") == 0);
 
-  return 0;
+  return test_link (link, true);
 }