[atf] Add a new atf-tests subpackage

Julio Merino jmmv at fedoraproject.org
Tue Jun 19 00:02:16 UTC 2012


commit 6fbfbe3b26b097733aa7d5636deaaff4ce4169d1
Author: Julio Merino <jmmv at julipedia.org>
Date:   Mon Jun 18 16:59:10 2012 -0400

    Add a new atf-tests subpackage
    
    This new subpackage ships all the run-time tests of ATF, ready to be
    run on any system after installation.

 README.Fedora |   22 ++++++++++++++++++++++
 atf.spec      |   50 +++++++++++++++++++++++++++++++++++++++++---------
 2 files changed, 63 insertions(+), 9 deletions(-)
---
diff --git a/README.Fedora b/README.Fedora
new file mode 100644
index 0000000..2e93289
--- /dev/null
+++ b/README.Fedora
@@ -0,0 +1,22 @@
+This package provides the full collection of test programs to validate
+the functionality of ATF, including all of its libraries and tools.
+
+Because the Linux Standard Base does not recognize a /usr/tests/
+directory (the standard location for ATF-based tests), the Fedora ATF
+packages place its own test suite within the libexec hierarchy.  In
+particular, such tests can be found in /usr/libexec/atf/tests/ .
+
+In order to execute these tests, you need to go into the directory and
+use either kyua(1) (provided by the kyua-cli package) or atf-run(1) to
+run them.  It is highly recommended that you use kyua(1) instead of
+atf-run(1), as the latter is deprecated in favor of the former.
+
+As an example, you can simply do the following to run the full test
+suite:
+
+    $ kyua test -k /usr/libexec/atf/tests/Kyuafile
+
+Or, using the deprecated tools:
+
+    $ cd /usr/libexec/atf/tests/
+    $ atf-run | atf-report
diff --git a/atf.spec b/atf.spec
index d3665ed..b65d020 100644
--- a/atf.spec
+++ b/atf.spec
@@ -6,12 +6,13 @@ License: BSD
 Group: Development/Tools
 URL: http://code.google.com/p/kyua/wiki/ATF
 Source0: http://kyua.googlecode.com/files/%{name}-%{version}.tar.gz
+Source1: README.Fedora
 Requires: libatf-c = %{version}-%{release}
 Requires: libatf-c++ = %{version}-%{release}
 Requires: libatf-sh = %{version}-%{release}
 
 %define _egdir %{_datadir}/atf/examples
-%define _testsdir %{_exec_prefix}/tests
+%define _testsdir %{_libexecdir}/atf/tests
 %define _xsldir %{_datadir}/atf/xsl
 
 %define common_description The Automated Testing Framework (ATF) is a collection of libraries and \
@@ -42,28 +43,28 @@ that Kyua should be used instead.
 %prep
 %setup -q
 
+# Put the README.Fedora file in the top-level directory of the source tree so
+# that the %doc call below can pick it up.
+cp -p %{SOURCE1} README.Fedora
+
 %build
 %configure INSTALL="/usr/bin/install -p" \
            --disable-static \
            --enable-unstable-shared
 sed -i 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' libtool
 sed -i 's|^runpath_var=LD_RUN_PATH|runpath_var=DIE_RPATH_DIE|g' libtool
-make %{?_smp_mflags} cssdir=%{_egdir} egdir=%{_egdir} xsldir=%{_xsldir}
+make %{?_smp_mflags} cssdir=%{_egdir} egdir=%{_egdir} \
+     pkgtestsdir=%{_testsdir} testsdir=%{_testsdir} xsldir=%{_xsldir}
 
 %check
 make check
 
 %install
 make install DESTDIR=%{buildroot} doc_DATA= cssdir=%{_egdir} egdir=%{_egdir} \
-             xsldir=%{_xsldir}
+             pkgtestsdir=%{_testsdir} testsdir=%{_pkgtestsdir} xsldir=%{_xsldir}
 rm %{buildroot}%{_libdir}/libatf*.a
 rm %{buildroot}%{_libdir}/libatf*.la
 
-# TODO: The tests should actually be installed once we decide what the right
-# value for testsdir is.  For now, just disable them altogether to get a
-# functional package.
-rm -rf %{buildroot}%{_testsdir}
-
 %files
 %doc AUTHORS COPYING NEWS README
 %{_bindir}/atf-config
@@ -84,7 +85,9 @@ rm -rf %{buildroot}%{_testsdir}
 %{_xsldir}
 
 %changelog
-* Sat Jun 9 2012 Julio Merino <jmmv at julipedia.org> 0.15-2
+* Mon Jun 18 2012 Julio Merino <jmmv at julipedia.org> 0.15-2
+- Added the atf-tests package, which provides the run-time tests of ATF
+  readily runnable by the end users.
 - Made the installation of the package preserve the build times of the files.
 - Fixed URL to the project's page.
 
@@ -92,6 +95,35 @@ rm -rf %{buildroot}%{_testsdir}
 - Initial release for Fedora.
 
 
+# Ideally, we would ship one tests package for every component, namely
+# atf-tests, libatf-c-tests, libatf-c++-tests and libatf-sh-tests.  However, the
+# test suite of ATF has not been written with this in mind, and the tests of one
+# component often have dependencies on the rest of the components.  It is much
+# easier to ship a single package with the whole test suite rather than
+# attempting to fight this fact.
+%package tests
+Summary: Automated Testing Framework - Test suite
+Requires: atf = %{version}-%{release}
+Requires: libatf-c = %{version}-%{release}
+Requires: libatf-c++ = %{version}-%{release}
+Requires: libatf-sh = %{version}-%{release}
+Requires: libatf-c-devel = %{version}-%{release}
+Requires: libatf-c++-devel = %{version}-%{release}
+Requires: libatf-sh-devel = %{version}-%{release}
+
+%description tests
+%{common_description}
+
+This package installs the run-time tests for all the components of ATF, which
+include tests for the C, C++ and POSIX shell libraries and the run-time tools.
+Please see the README.Fedora file in the documentation directory for further
+details on how to run the installed tests.
+
+%files tests
+%doc README.Fedora
+%{_testsdir}
+
+
 %package -n libatf-c
 Summary: Automated Testing Framework - C bindings
 


More information about the scm-commits mailing list