Integrate tests with autotools
authorNikolaus Rath <Nikolaus@rath.org>
Tue, 29 Mar 2016 21:17:16 +0000 (14:17 -0700)
committerNikolaus Rath <Nikolaus@rath.org>
Tue, 29 Mar 2016 21:17:49 +0000 (14:17 -0700)
configure.ac
test/.gitignore
test/Makefile [deleted file]
test/Makefile.am [new file with mode: 0644]

index 29a281d86ab18b97591aa908413fd53e6323ed7d..7ca9f4f8bdddc04b26a4500272ca5898327bf22e 100644 (file)
@@ -29,13 +29,15 @@ AC_ARG_ENABLE(util,
        [  --enable-util           Compile with util ])
 AC_ARG_ENABLE(example,
        [  --enable-example        Compile with examples ])
+AC_ARG_ENABLE(test,
+       [  --enable-test           Compile with tests ])
 AC_ARG_ENABLE(mtab,
        [  --disable-mtab          Disable and ignore usage of /etc/mtab ])
 
 AC_ARG_WITH(pkgconfigdir,
-            [  --with-pkgconfigdir=DIR      pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
-            [pkgconfigdir=$withval],
-            [pkgconfigdir='${libdir}/pkgconfig'])
+           [  --with-pkgconfigdir=DIR      pkgconfig file in DIR @<:@LIBDIR/pkgconfig@:>@],
+           [pkgconfigdir=$withval],
+           [pkgconfigdir='${libdir}/pkgconfig'])
 AC_SUBST(pkgconfigdir)
 
 subdirs2="include"
@@ -49,6 +51,9 @@ fi
 if test "$enable_example" != "no"; then
        subdirs2="$subdirs2 example";
 fi
+if test "$enable_test" != "no"; then
+       subdirs2="$subdirs2 test";
+fi
 if test "$enable_mtab" = "no"; then
        AC_DEFINE(IGNORE_MTAB, 1, [Don't update /etc/mtab])
 fi
@@ -120,7 +125,7 @@ if test "$arch" = linux -a "$cross_compiling" != "yes"; then
        fi
 fi
 
-AC_CONFIG_FILES([fuse3.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile doc/Makefile])
+AC_CONFIG_FILES([fuse3.pc Makefile lib/Makefile util/Makefile example/Makefile include/Makefile doc/Makefile test/Makefile])
 AC_OUTPUT
 
 if test "$util_linux_ok" = no; then
index 7b95378de697fcb27083d4413567246f291d6145..9daeafb9864cf43055ae93beb0afd6c7d144bfa4 100644 (file)
@@ -1,2 +1 @@
-!Makefile
 test
diff --git a/test/Makefile b/test/Makefile
deleted file mode 100644 (file)
index 738dd53..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-CC=gcc
-CFLAGS=-Wall -W
-
-all: test
-
-clean:
-       rm -f *.o test
diff --git a/test/Makefile.am b/test/Makefile.am
new file mode 100644 (file)
index 0000000..55d6950
--- /dev/null
@@ -0,0 +1,2 @@
+bin_PROGRAMS = test
+test_SOURCES = test.c