[lutok] Add a new lutok-tests subpackage

Julio Merino jmmv at fedoraproject.org
Tue Jun 19 00:14:53 UTC 2012


commit 13e6c2de37ddfd095082d8e54eb1382d94deec9f
Author: Julio Merino <jmmv at julipedia.org>
Date:   Mon Jun 18 20:03:59 2012 -0400

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

 README.Fedora |   13 +++++++++++++
 lutok.spec    |   40 +++++++++++++++++++++++++++++++++++-----
 2 files changed, 48 insertions(+), 5 deletions(-)
---
diff --git a/README.Fedora b/README.Fedora
new file mode 100644
index 0000000..ae8154a
--- /dev/null
+++ b/README.Fedora
@@ -0,0 +1,13 @@
+This package provides the full collection of test programs to validate
+the functionality of Lutok.
+
+Because the Linux Standard Base does not recognize a /usr/tests/
+directory (the standard location for ATF-based tests), the test suite is
+installed within the libexec hierarchy.  In particular, such tests can
+be found in /usr/libexec/lutok/tests/ .
+
+In order to execute these tests, you need to install the kyua(1) tool
+from the kyua-cli package.  Once that is done, you can simply run the
+tests by issuing the following command:
+
+    $ kyua test -k /usr/libexec/lutok/tests/Kyuafile
diff --git a/lutok.spec b/lutok.spec
index 4c8e1a4..fe452a4 100644
--- a/lutok.spec
+++ b/lutok.spec
@@ -1,14 +1,18 @@
 Summary: Lightweight C++ API library for Lua
 Name: lutok
 Version: 0.2
-Release: 1%{?dist}
+Release: 2%{?dist}
 License: BSD
 Group: Development/Libraries
 URL: http://code.google.com/p/lutok/
 Source0: http://lutok.googlecode.com/files/lutok-%{version}.tar.gz
+Source1: README.Fedora
 Requires: lua >= 5.1, lua < 5.2
+BuildRequires: libatf-c++-devel >= 0.15
 BuildRequires: lua-devel >= 5.1, lua-devel < 5.2
 
+%define _testsdir %{_libexecdir}/lutok/tests
+
 %description
 Lutok provides thin C++ wrappers around the Lua C API to ease the
 interaction between C++ and Lua.  These wrappers make intensive use of
@@ -27,19 +31,26 @@ performance.
 %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 --docdir=%{_defaultdocdir}/lutok-doc-%{version} \
            --disable-static \
            --htmldir=%{_defaultdocdir}/lutok-doc-%{version}/html \
-           --without-atf \
            --without-doxygen
-make %{?_smp_mflags}
+make %{?_smp_mflags} testsdir=%{_testsdir}
 
 %check
-make check
+# In order to enable this, we need to add a BuildRequires on kyua-cli.  The
+# problem is that kyua-cli depends on lutok.  Introducing a circular dependency
+# for this minor benefit does not seem like the best move.  After all, we can
+# always install lutok-tests later and run the tests post-install.
+#make check testsdir=%{_testsdir}
 
 %install
-make install DESTDIR=%{buildroot} doc_DATA=
+make install DESTDIR=%{buildroot} doc_DATA= testsdir=%{_testsdir}
 rm %{buildroot}%{_libdir}/liblutok.la
 
 %files
@@ -78,7 +89,26 @@ of the library.
 %files doc
 %{_defaultdocdir}/lutok-doc-%{version}
 
+%package tests
+Summary: Run-time tests of the Lutok library
+Requires: %{name} = %{version}-%{release}
+Requires: %{name}-devel = %{version}-%{release}
+Requires: libatf-c++ >= 0.15
+
+%description tests
+This package installs the run-time tests for the Lutok library.
+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}
+
 %changelog
+* Mon Jun 18 2012 Julio Merino <jmmv at google.com> 0.2-2
+- Added the lutok-tests package providing the run-time tests of Lutok, readily
+  runnable by the end users.
+
 * Wed May 30 2012 Julio Merino <jmmv at google.com> 0.2-1
 - Package updated to Lutok 0.2.
 


More information about the scm-commits mailing list