File ghc-HTF.spec of Package ghc-HTF
#
# spec file for package ghc-HTF
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global pkg_name HTF
%bcond_with tests
Name: ghc-%{pkg_name}
Version: 0.13.1.0
Release: 0
Summary: The Haskell Test Framework
License: LGPL-2.0+
Group: Development/Languages/Other
Url: https://hackage.haskell.org/package/%{pkg_name}
Source0: https://hackage.haskell.org/package/%{pkg_name}-%{version}/%{pkg_name}-%{version}.tar.gz
BuildRequires: chrpath
BuildRequires: ghc-Cabal-devel
BuildRequires: ghc-Diff-devel
BuildRequires: ghc-HUnit-devel
BuildRequires: ghc-QuickCheck-devel
BuildRequires: ghc-aeson-devel
BuildRequires: ghc-array-devel
BuildRequires: ghc-base64-bytestring-devel
BuildRequires: ghc-bytestring-devel
BuildRequires: ghc-containers-devel
BuildRequires: ghc-cpphs-devel
BuildRequires: ghc-directory-devel
BuildRequires: ghc-haskell-src-devel
BuildRequires: ghc-lifted-base-devel
BuildRequires: ghc-monad-control-devel
BuildRequires: ghc-mtl-devel
BuildRequires: ghc-old-time-devel
BuildRequires: ghc-pretty-devel
BuildRequires: ghc-process-devel
BuildRequires: ghc-random-devel
BuildRequires: ghc-regex-compat-devel
BuildRequires: ghc-rpm-macros
BuildRequires: ghc-text-devel
BuildRequires: ghc-time-devel
BuildRequires: ghc-unix-devel
BuildRequires: ghc-vector-devel
BuildRequires: ghc-xmlgen-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%if %{with tests}
BuildRequires: ghc-aeson-pretty-devel
BuildRequires: ghc-filepath-devel
BuildRequires: ghc-template-haskell-devel
BuildRequires: ghc-temporary-devel
BuildRequires: ghc-unordered-containers-devel
%endif
BuildRequires: cpphs
%description
The Haskell Test Framework (/HTF/ for short) lets you define unit tests
(<http://hunit.sourceforge.net>), QuickCheck properties
(<http://www.cs.chalmers.se/~rjmh/QuickCheck/>), and black box tests in an easy
and convenient way. HTF uses a custom preprocessor that collects test
definitions automatically. Furthermore, the preprocessor allows HTF to report
failing test cases with exact file name and line number information.
Additionally, HTF tries to produce highly readable output for failing tests:
for example, it colors and pretty prints expected and actual results and
provides a diff between the two values.
The documentation of the "Test.Framework.Tutorial" module provides a tutorial
for HTF. There is also a slightly out-dated blog article
(<http://factisresearch.blogspot.de/2011/10/new-version-of-htf-with-diffs-colors.html>)
demonstrating HTF's coloring, pretty-printing and diff functionality.
/HEADS UP, backwards incomatibility with prior versions:/
In version 0.10.0.0, the following changes could break code compiled against
version 0.9.*:
* "Test.Framework" now longer exports all of "Test.Framework.TestManager" and
"Test.Framework.BlackBoxTest". For modules that only define tests, no changes
should be necessary. However, you likely need to adjust your test runner module
by importing "Test.Framework.TestManager" and possibly
"Test.Framework.BlackBoxTest".
* Some reorganization in "Test.Framework.TestManager" and related modules,
introduction of "Test.Framework.TestTypes". Usually, your code should not be
affected by these changes.
Starting with version 0.9.0.0, HTF uses a new strategy for collecting the
testcases defined in your project (see "Test.Framework.Tutorial" for a
description of this strategy). If you used version 0.8.* or earlier of HTF,
this /will break your build!/ However, it's rather easy to bring you project in
line with the new HTF version. Here are the steps that will most likely resolve
your backwards incompatibility problems:
* If a module exports the 'allHTFTests' symbol, this export must be changed to
'htf_thisModulesTests'.
* If an import declaration of some module hides the 'allHTFTests' symbol, you
can simply remove the hiding clause for 'allHTFTests'.
* If a module collects and executes tests from several other modules, the
collecting module has to be changed as follows: add '{-# OPTIONS_GHC
-F -pgmF htfpp #-}' to the top of the collecting module, import the
other modules with the '{-@ HTF_TESTS @-}' annotation, use
the symbol 'htf_importedTests' for referencing the imported tests. See
"Test.Framework.Tutorial" for details.
%package devel
Summary: Haskell %{pkg_name} library development files
Group: Development/Libraries/Other
Requires: %{name} = %{version}-%{release}
Requires: ghc-compiler = %{ghc_version}
Requires(post): ghc-compiler = %{ghc_version}
Requires(postun): ghc-compiler = %{ghc_version}
%description devel
This package provides the Haskell %{pkg_name} library development files.
%prep
%setup -q -n %{pkg_name}-%{version}
%build
%ghc_lib_build
%install
%ghc_lib_install
%ghc_fix_dynamic_rpath htfpp
%check
%cabal_test
%post devel
%ghc_pkg_recache
%postun devel
%ghc_pkg_recache
%files -f %{name}.files
%defattr(-,root,root,-)
%doc LICENSE
%{_bindir}/htfpp
%files devel -f %{name}-devel.files
%defattr(-,root,root,-)
%doc ChangeLog README.md TODO.org
%changelog