summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYevhenii Shapovalov <yshapova@redhat.com>2017-12-18 16:33:58 +0200
committerYevhenii Shapovalov <yshapova@redhat.com>2017-12-18 16:33:58 +0200
commitb858fccc3f517e450377b767f62a85dcbacc9dde (patch)
treedfa9c438b58f27d218488a1dcc8f19ec6c70760c
parenta9a53fbc4f92e1b3104c68770837258b40f86551 (diff)
downloadlibtool-add_tests.tar.gz
libtool-add_tests.tar.xz
libtool-add_tests.zip
Add CI tests using the standard test interfaceHEADadd_tests
-rw-r--r--tests/tests.yml21
-rw-r--r--tests/testsuite/Makefile62
-rw-r--r--tests/testsuite/PURPOSE3
-rw-r--r--tests/testsuite/runtest.sh58
4 files changed, 144 insertions, 0 deletions
diff --git a/tests/tests.yml b/tests/tests.yml
new file mode 100644
index 0000000..029f359
--- /dev/null
+++ b/tests/tests.yml
@@ -0,0 +1,21 @@
+---
+# Tests for classic and container
+- hosts: localhost
+ roles:
+ - role: standard-test-beakerlib
+ tags:
+ - classic
+ - container
+ tests:
+ - testsuite
+ required_packages:
+ - autoconf
+ - automake
+ - gcc-gfortran
+ - libtool
+ - libstdc++-devel
+ - make
+ - rpm-build
+ - texinfo
+ - wget
+ - yum-utils
diff --git a/tests/testsuite/Makefile b/tests/testsuite/Makefile
new file mode 100644
index 0000000..0d69c1b
--- /dev/null
+++ b/tests/testsuite/Makefile
@@ -0,0 +1,62 @@
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Makefile of /tools/libtool/Sanity/testsuite
+# Description: runs testsuite
+# Author: Michal Nowak <mnowak@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
+#
+# 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 3 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, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+export TEST=/tools/libtool/Sanity/testsuite
+export TESTVERSION=1.0
+
+BUILT_FILES=
+
+FILES=$(METADATA) runtest.sh Makefile PURPOSE
+
+.PHONY: all install download clean
+
+run: $(FILES) build
+ ./runtest.sh
+
+build: $(BUILT_FILES)
+ chmod a+x runtest.sh
+
+clean:
+ rm -f *~ $(BUILT_FILES)
+
+
+include /usr/share/rhts/lib/rhts-make.include
+
+$(METADATA): Makefile
+ @echo "Owner: Michal Nowak <mnowak@redhat.com>" > $(METADATA)
+ @echo "Name: $(TEST)" >> $(METADATA)
+ @echo "TestVersion: $(TESTVERSION)" >> $(METADATA)
+ @echo "Path: $(TEST_DIR)" >> $(METADATA)
+ @echo "Description: runs testsuite" >> $(METADATA)
+ @echo "Type: Sanity" >> $(METADATA)
+ @echo "TestTime: 40m" >> $(METADATA)
+ @echo "RunFor: libtool" >> $(METADATA)
+ @echo "Requires: libtool yum-utils rpm-build autoconf automake texinfo libstdc++-devel gcc-gfortran gcc-java" >> $(METADATA)
+ @echo "Priority: Normal" >> $(METADATA)
+ @echo "License: GPLv3" >> $(METADATA)
+ @echo "Confidential: no" >> $(METADATA)
+ @echo "Destructive: no" >> $(METADATA)
+
+ rhts-lint $(METADATA)
diff --git a/tests/testsuite/PURPOSE b/tests/testsuite/PURPOSE
new file mode 100644
index 0000000..8029490
--- /dev/null
+++ b/tests/testsuite/PURPOSE
@@ -0,0 +1,3 @@
+PURPOSE of /tools/libtool/Sanity/testsuite
+Description: runs testsuite
+Author: Michal Nowak <mnowak@redhat.com>
diff --git a/tests/testsuite/runtest.sh b/tests/testsuite/runtest.sh
new file mode 100644
index 0000000..827d8f4
--- /dev/null
+++ b/tests/testsuite/runtest.sh
@@ -0,0 +1,58 @@
+#!/bin/bash
+# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# runtest.sh of /tools/libtool/Sanity/testsuite
+# Description: runs testsuite
+# Author: Michal Nowak <mnowak@redhat.com>
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+#
+# Copyright (c) 2010 Red Hat, Inc. All rights reserved.
+#
+# 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 3 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, see http://www.gnu.org/licenses/.
+#
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+# Include rhts environment
+. /usr/bin/rhts-environment.sh
+. /usr/lib/beakerlib/beakerlib.sh
+
+PACKAGE="libtool"
+
+rlJournalStart
+ rlPhaseStartSetup
+ rlAssertRpm $PACKAGE
+ rlRun "TmpDir=\`mktemp -d\`" 0 "Creating tmp directory"
+ rlRun "pushd $TmpDir"
+ rlRun "rlFetchSrcForInstalled ${PACKAGE}"
+ rlRun "yum-builddep --nogpgcheck -y libtool-*.src.rpm"
+ rlRun "rpm -ivh libtool-*src.rpm"
+ specfile="$(rpm --eval '%_specdir')/${PACKAGE}.spec"
+ rpmbuild -bc ${specfile}
+ builddir="$(rpm --eval '%_builddir')/${PACKAGE}-*"
+ pushd ${builddir}
+ rlPhaseEnd
+
+ rlPhaseStartTest
+ rlRun "make check VERBOSE=yes" 0 "Run testsuite"
+ rlPhaseEnd
+
+ rlPhaseStartCleanup
+ popd
+ rlRun "popd"
+ rlRun "rm -r $TmpDir" 0 "Removing tmp directory"
+ rlPhaseEnd
+rlJournalPrintText
+rlJournalEnd