forked from pool/shunit2
b8b880c03a
- Update to version 2.1.7: * Colorized output * shUnit2 no longer exits with an 'OK' result if there were syntax errors * changed license to Apache 2.0 - Update to version 2.1.8: * Users can now define a custom prefix for test function names (SHUNIT_TEST_PREFIX) * Syntax errors in functions are now treated as test failures * Test now fail when setup() or tearDown() fail * Add assertContains, assertNotContains, failFound and failNotFound functions - delete patches shunit2-examples.diff and shunit2-gen_test_results.sh.diff, not needed - delete source file lgpl-2.1.txt - do not install test scripts - enable package testing with script test_runner - provide compat symlink from /usr/share/shunit2/shunit2 to /usr/share/shunit2/src/shunit2 - source /usr/bin/shunit2 in examples, so no additional path settings are needed to use it OBS-URL: https://build.opensuse.org/package/show/devel:tools/shunit2?expand=0&rev=9
71 lines
2.2 KiB
RPMSpec
71 lines
2.2 KiB
RPMSpec
#
|
|
# spec file for package shunit2
|
|
#
|
|
# Copyright (c) 2024 SUSE LLC
|
|
#
|
|
# 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 https://bugs.opensuse.org/
|
|
#
|
|
|
|
|
|
%define SHUNIT_HOME %{_datadir}/shunit2
|
|
Name: shunit2
|
|
Version: 2.1.8
|
|
Release: 0
|
|
Summary: Test Framework for Bourne Based Shell Scripts
|
|
License: Apache-2.0
|
|
Group: Development/Languages/Other
|
|
URL: https://github.com/kward/shunit2
|
|
Source: https://github.com/kward/shunit2/archive/refs/tags/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
|
|
BuildRequires: bash
|
|
BuildRequires: ksh
|
|
BuildRequires: zsh
|
|
BuildArch: noarch
|
|
|
|
%description
|
|
shUnit2 is a xUnit unit test framework for Bourne based shell scripts,
|
|
and it is designed to work in a similar manner to JUnit, PyUnit, etc.
|
|
If you have ever had the desire to write a unit test for a shell
|
|
script, shUnit2 can do the job.
|
|
|
|
%prep
|
|
%autosetup
|
|
|
|
%build
|
|
#---source /usr/bin/shunit2 in examples, so no additional path settings are needed to use it:
|
|
for i in examples/*.sh; do
|
|
sed -i 's|^. ../shunit2|. shunit2|g' "$i"
|
|
done
|
|
|
|
%install
|
|
mkdir -p -m 755 %{buildroot}%{_bindir} %{buildroot}%{SHUNIT_HOME} %{buildroot}%{SHUNIT_HOME}/src
|
|
install -m 755 shunit2 %{buildroot}%{_bindir}/%{name}
|
|
ln -sr %{buildroot}%{_bindir}/%{name} %{buildroot}%{SHUNIT_HOME}/%{name}
|
|
cp -a lib %{buildroot}%{SHUNIT_HOME}/
|
|
#---compat symlink, older versions resided in src/:
|
|
ln -sr %{buildroot}%{SHUNIT_HOME}/%{name} %{buildroot}%{SHUNIT_HOME}/src/%{name}
|
|
|
|
%check
|
|
env SHUNIT_COLOR='none' ./test_runner
|
|
|
|
%files
|
|
%license LICENSE
|
|
%doc README.md doc/* examples
|
|
%{_bindir}/%{name}
|
|
%dir %{SHUNIT_HOME}
|
|
%dir %{SHUNIT_HOME}/lib
|
|
%dir %{SHUNIT_HOME}/src
|
|
%{SHUNIT_HOME}/%{name}
|
|
%{SHUNIT_HOME}/src/%{name}
|
|
%{SHUNIT_HOME}/lib/*
|
|
|
|
%changelog
|