Tests for zsh, ksh and ash.
authorPekka Riikonen <priikone@silcnet.org>
Tue, 19 Apr 2005 23:29:20 +0000 (23:29 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 19 Apr 2005 23:29:20 +0000 (23:29 +0000)
apps/autodist/tests/Makefile.am
apps/autodist/tests/autodist3.test [new file with mode: 0755]
apps/autodist/tests/autodist4.test [new file with mode: 0755]
apps/autodist/tests/autodist5.test [new file with mode: 0755]

index faf528af340293e005beb7a1bc7414035cfd9433..c1e2ae6532dd10e333584d767869eb78b43892a6 100644 (file)
@@ -19,7 +19,10 @@ AUTOMAKE_OPTIONS = 1.0 no-dependencies foreign
 
 TESTS =                        \
        autodist1.test          \
-       autodist2.test
+       autodist2.test          \
+       autodist3.test          \
+       autodist4.test          \
+       autodist5.test
 
 clean-local:
        -rm -rf test
diff --git a/apps/autodist/tests/autodist3.test b/apps/autodist/tests/autodist3.test
new file mode 100755 (executable)
index 0000000..92746fb
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+AUTODIST=../autodist
+
+rm -f ./autodist
+
+echo "Testing with /bin/zsh"
+
+# Change shell to zsh
+if test '!' -f /bin/zsh; then
+  echo "/bin/zsh does not exist, cannot run test"
+  exit 0
+fi
+cat $AUTODIST | sed 's/#!\/bin\/sh/#!\/bin\/zsh/' > ./autodist
+
+AUTODIST=../autodist   # from inside tests/test
+
+rm -rf test
+mkdir test
+
+cd test || exit 1
+
+chmod +x $AUTODIST || exit 1
+
+cat << EOF > configure.ad
+AD_INIT
+#ifdef _DIST_TEST
+AC_CANONICAL_BUILD
+AM_INIT_AUTOMAKE
+AC_PREREQ(2.52)
+AC_CONFIG_HEADERS(config.h)
+AD_INCLUDE_CONFIGURE
+AC_CONFIG_FILES(
+Makefile
+)
+AC_OUTPUT
+echo configure.ad ok
+#endif _DIST_TEST
+EOF
+
+cat << EOF > Makefile.ad
+SUBDIRS=       \\
+#ifndef _DIST_TEST
+       nodef   \\
+#endif _DIST_TEST
+       .       \\
+
+EOF
+
+rm -rf distdir subdir
+mkdir -p subdir || exit 1
+
+cat << EOF > subdir/configure.ad
+# subdir/configure.ad fragment
+#ifndef _DIST_NODEF
+#ifdef _DIST_TEST
+echo "_DIST_NODEF ok"
+#endif _DIST_TEST
+#endif _DIST_NODEF
+EOF
+
+$AUTODIST -i || exit 1
+if test '!' -d distdir; then
+  echo "error: distdir/ does no exist"
+  exit 1
+fi 
+
+cp -p ../../default distdir || exit 1
+cp -p ../../autodist.conf distdir || exit 1
+
+cat << EOF > distdir/test
+name Test Distribution
+package test-distro
+bug-report test-dist@test.org
+define _DIST_TEST
+EOF
+
+touch README NEWS AUTHORS ChangeLog
+
+echo "inherit test" >> distdir/default
+
+$AUTODIST || exit 1
+$AUTODIST test 1.0 || exit 1
+
+./configure || exit 1
+make || exit 1
+echo make ok
+
+$AUTODIST -m || exit 1
+
+if test '!' -f test-distro-1.0.tar.gz; then
+  echo "error: makedist failed"
+  exit 1
+fi
+
+echo test ok
+
+# Cleanup
+rm -rf subdir distdir $AUTODIST
+
diff --git a/apps/autodist/tests/autodist4.test b/apps/autodist/tests/autodist4.test
new file mode 100755 (executable)
index 0000000..2ed0771
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+AUTODIST=../autodist
+
+rm -f ./autodist
+
+echo "Testing with /bin/ksh"
+
+# Change shell to ksh
+if test '!' -f /bin/ksh; then
+  echo "/bin/zsh does not exist, cannot run test"
+  exit 0
+fi
+cat $AUTODIST | sed 's/#!\/bin\/sh/#!\/bin\/ksh/' > ./autodist
+
+AUTODIST=../autodist   # from inside tests/test
+
+rm -rf test
+mkdir test
+
+cd test || exit 1
+
+chmod +x $AUTODIST || exit 1
+
+cat << EOF > configure.ad
+AD_INIT
+#ifdef _DIST_TEST
+AC_CANONICAL_BUILD
+AM_INIT_AUTOMAKE
+AC_PREREQ(2.52)
+AC_CONFIG_HEADERS(config.h)
+AD_INCLUDE_CONFIGURE
+AC_CONFIG_FILES(
+Makefile
+)
+AC_OUTPUT
+echo configure.ad ok
+#endif _DIST_TEST
+EOF
+
+cat << EOF > Makefile.ad
+SUBDIRS=       \\
+#ifndef _DIST_TEST
+       nodef   \\
+#endif _DIST_TEST
+       .       \\
+
+EOF
+
+rm -rf distdir subdir
+mkdir -p subdir || exit 1
+
+cat << EOF > subdir/configure.ad
+# subdir/configure.ad fragment
+#ifndef _DIST_NODEF
+#ifdef _DIST_TEST
+echo "_DIST_NODEF ok"
+#endif _DIST_TEST
+#endif _DIST_NODEF
+EOF
+
+$AUTODIST -i || exit 1
+if test '!' -d distdir; then
+  echo "error: distdir/ does no exist"
+  exit 1
+fi 
+
+cp -p ../../default distdir || exit 1
+cp -p ../../autodist.conf distdir || exit 1
+
+cat << EOF > distdir/test
+name Test Distribution
+package test-distro
+bug-report test-dist@test.org
+define _DIST_TEST
+EOF
+
+touch README NEWS AUTHORS ChangeLog
+
+echo "inherit test" >> distdir/default
+
+$AUTODIST || exit 1
+$AUTODIST test 1.0 || exit 1
+
+./configure || exit 1
+make || exit 1
+echo make ok
+
+$AUTODIST -m || exit 1
+
+if test '!' -f test-distro-1.0.tar.gz; then
+  echo "error: makedist failed"
+  exit 1
+fi
+
+echo test ok
+
+# Cleanup
+rm -rf subdir distdir $AUTODIST
+
diff --git a/apps/autodist/tests/autodist5.test b/apps/autodist/tests/autodist5.test
new file mode 100755 (executable)
index 0000000..96493d9
--- /dev/null
@@ -0,0 +1,100 @@
+#!/bin/sh
+
+AUTODIST=../autodist
+
+rm -f ./autodist
+
+echo "Testing with /bin/ash"
+
+# Change shell to ash
+if test '!' -f /bin/ash; then
+  echo "/bin/zsh does not exist, cannot run test"
+  exit 0
+fi
+cat $AUTODIST | sed 's/#!\/bin\/sh/#!\/bin\/ash/' > ./autodist
+
+AUTODIST=../autodist   # from inside tests/test
+
+rm -rf test
+mkdir test
+
+cd test || exit 1
+
+chmod +x $AUTODIST || exit 1
+
+cat << EOF > configure.ad
+AD_INIT
+#ifdef _DIST_TEST
+AC_CANONICAL_BUILD
+AM_INIT_AUTOMAKE
+AC_PREREQ(2.52)
+AC_CONFIG_HEADERS(config.h)
+AD_INCLUDE_CONFIGURE
+AC_CONFIG_FILES(
+Makefile
+)
+AC_OUTPUT
+echo configure.ad ok
+#endif _DIST_TEST
+EOF
+
+cat << EOF > Makefile.ad
+SUBDIRS=       \\
+#ifndef _DIST_TEST
+       nodef   \\
+#endif _DIST_TEST
+       .       \\
+
+EOF
+
+rm -rf distdir subdir
+mkdir -p subdir || exit 1
+
+cat << EOF > subdir/configure.ad
+# subdir/configure.ad fragment
+#ifndef _DIST_NODEF
+#ifdef _DIST_TEST
+echo "_DIST_NODEF ok"
+#endif _DIST_TEST
+#endif _DIST_NODEF
+EOF
+
+$AUTODIST -i || exit 1
+if test '!' -d distdir; then
+  echo "error: distdir/ does no exist"
+  exit 1
+fi 
+
+cp -p ../../default distdir || exit 1
+cp -p ../../autodist.conf distdir || exit 1
+
+cat << EOF > distdir/test
+name Test Distribution
+package test-distro
+bug-report test-dist@test.org
+define _DIST_TEST
+EOF
+
+touch README NEWS AUTHORS ChangeLog
+
+echo "inherit test" >> distdir/default
+
+$AUTODIST || exit 1
+$AUTODIST test 1.0 || exit 1
+
+./configure || exit 1
+make || exit 1
+echo make ok
+
+$AUTODIST -m || exit 1
+
+if test '!' -f test-distro-1.0.tar.gz; then
+  echo "error: makedist failed"
+  exit 1
+fi
+
+echo test ok
+
+# Cleanup
+rm -rf subdir distdir $AUTODIST
+