summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRalf Corsépius <corsepiu@fedoraproject.org>2007-08-20 16:56:34 +0200
committerRalf Corsépius <corsepiu@fedoraproject.org>2007-08-20 16:56:34 +0200
commit88fc7a04bc27fd14c08f2f95e15c3a6c50e4cd7b (patch)
tree32527a937921eba45273a891199a877bcf2cd6a2 /tests
parent89c7d93e608353a2b7f4925948e2b8ba4b2721cb (diff)
downloadrpm-88fc7a04bc27fd14c08f2f95e15c3a6c50e4cd7b.tar.gz
rpm-88fc7a04bc27fd14c08f2f95e15c3a6c50e4cd7b.tar.bz2
rpm-88fc7a04bc27fd14c08f2f95e15c3a6c50e4cd7b.zip
Add rpmbuild.at.
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/rpmbuild.at117
-rw-r--r--tests/rpmtests.at1
3 files changed, 119 insertions, 1 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index bc4666b93..eeb2d99bc 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -16,7 +16,7 @@ $(TESTSUITE): $(srcdir)/rpmtests.at $(TESTSUITE_AT) package.m4
mv $@.tmp $@
## testsuite components
-TESTSUITE_AT = rpmgeneral.at rpmquery.at rpmdb.at
+TESTSUITE_AT = rpmgeneral.at rpmquery.at rpmdb.at rpmbuild.at
EXTRA_DIST += $(TESTSUITE_AT)
## testsuite data
diff --git a/tests/rpmbuild.at b/tests/rpmbuild.at
new file mode 100644
index 000000000..3a67b4b27
--- /dev/null
+++ b/tests/rpmbuild.at
@@ -0,0 +1,117 @@
+# rpmbuild.at: test rpmbuild
+#
+# Copyright (C) 2007 Ralf Corsépius <corsepiu@fedoraproject.org>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+# ------------------------------
+# Check rpmbuild -ba *.spec
+AT_SETUP([rpmbuild -ba *.spec])
+AT_CHECK([
+TOPDIR="${abs_builddir}"/testing/build
+
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+AS_MKDIR_P(${TOPDIR}/BUILD)
+AS_MKDIR_P(${TOPDIR}/SPECS)
+AS_MKDIR_P(${TOPDIR}/RPMS)
+AS_MKDIR_P(${TOPDIR}/SRPMS)
+
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz ${TOPDIR}/SOURCES
+
+rpmbuild \
+ --rcfile=${RPMRC} \
+ --define "_topdir ${TOPDIR}" \
+ -ba "${abs_srcdir}"/data/SPECS/hello.spec
+],
+[0],
+[ignore],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check if rpmbuild -ba *.spec
+# honours a relative topdir with --root
+AT_SETUP([rpmbuild --root=... -ba *.spec])
+AT_CHECK([
+TOPDIR="${abs_builddir}"/testing/build
+
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+AS_MKDIR_P(${TOPDIR}/BUILD)
+AS_MKDIR_P(${TOPDIR}/SPECS)
+AS_MKDIR_P(${TOPDIR}/RPMS)
+AS_MKDIR_P(${TOPDIR}/SRPMS)
+
+cp "${abs_srcdir}"/data/SOURCES/hello-1.0.tar.gz ${TOPDIR}/SOURCES
+
+rpmbuild \
+ --rcfile=${RPMRC} \
+ --define "_topdir build" \
+ --root="${abs_builddir}"/testing \
+ -ba "${abs_srcdir}"/data/SPECS/hello.spec
+],
+[0],
+[ignore],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check if rpmbuild --rebuild *.src.rpm
+# honours a relative topdir with --root
+AT_SETUP([rpmbuild --rebuild])
+AT_CHECK([
+TOPDIR="${abs_builddir}"/testing/build
+
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+AS_MKDIR_P(${TOPDIR}/BUILD)
+AS_MKDIR_P(${TOPDIR}/SPECS)
+AS_MKDIR_P(${TOPDIR}/RPMS)
+AS_MKDIR_P(${TOPDIR}/SRPMS)
+
+rpmbuild \
+ --rcfile=${RPMRC} \
+ --define "_topdir ${TOPDIR}" \
+ --rebuild "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm
+],
+[0],
+[ignore],
+[ignore])
+AT_CLEANUP
+
+# ------------------------------
+# Check if rpmbuild --rebuild *.src.rpm works
+AT_SETUP([rpmbuild --root=... --rebuild])
+AT_CHECK([
+TOPDIR="${abs_builddir}"/testing/build
+
+rm -rf ${TOPDIR}
+AS_MKDIR_P(${TOPDIR}/SOURCES)
+AS_MKDIR_P(${TOPDIR}/BUILD)
+AS_MKDIR_P(${TOPDIR}/SPECS)
+AS_MKDIR_P(${TOPDIR}/RPMS)
+AS_MKDIR_P(${TOPDIR}/SRPMS)
+
+rpmbuild \
+ --rcfile=${RPMRC} \
+ --define "_topdir build" \
+ --root="${abs_builddir}"/testing \
+ --rebuild "${abs_srcdir}"/data/SRPMS/hello-1.0-1.src.rpm
+],
+[0],
+[ignore],
+[ignore])
+AT_CLEANUP
diff --git a/tests/rpmtests.at b/tests/rpmtests.at
index eded72eb1..c121deb81 100644
--- a/tests/rpmtests.at
+++ b/tests/rpmtests.at
@@ -5,3 +5,4 @@ AT_TESTED(rpm rpmbuild rpmquery)
m4_include([rpmgeneral.at])
m4_include([rpmquery.at])
m4_include([rpmdb.at])
+m4_include([rpmbuild.at])