File gpc-test.spec of Package gpc-test
################# Copyright (c) 2012-2022 Trevor Blight #######################
#
# spec file for gpc test suite
#
# 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 each 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.
# This file and all modifications and additions to the pristine
# package are under the same license as the package itself.
#
# gpc uses now GPL version 3
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
# norootforbuild
Name: gpc-test
Version: 1
Release: lp154.34.1
Summary: gpc test suite
License: GPL-3.0+
Group: Development/Languages/Other
URL: http://www.gnu-pascal.de
Source0: gpc-test-20070904.tar.bz2
Source1: iso7185pat.tar.gz
Patch0: gpc-fix_tests.patch
BuildRequires: gpc, gmp-devel, ncurses-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
GPC test suite
This package contains only a test result summary file and doesn't need to
be installed.
It's only useful in the opensuse build service to run regression tests
against gpc
# prevent empty debug files list error
%global debug_package %{nil}
%prep
%setup -q -c gpc-test
%setup -q -T -D -a 1
# very old versions of rpm do not like this form of patch
%patch -P0 -p2
%build
gpc --executable-file-name --classic-pascal iso7185pat.pas
./iso7185pat < iso7185pat.in | awk -f patCheck.awk | tee iso7185pat.out
grep -c 'no failures' iso7185pat.out && PASS1=0
#PASS1=$?
cd p/test
%__make | tee ../../gpc.out
# return code based on a valid test results file
grep -c 'expected passes' gpc.out && PASS2=0
cd ../..
cat iso7185pat.out gpc.out > test_results
#test $PASS1 && test $PASS2 -eq 0 && echo pass && exit 0
#echo fail
#exit 1
%install
# install test_results into doc directory
%__mkdir_p %{?buildroot:%{buildroot}}%{_docdir}/gpc
%{__install} -m 644 \
test_results \
%{?buildroot:%{buildroot}}%{_docdir}/gpc
%clean
%{?buildroot:%__rm -rf "%{buildroot}"}
%files
%defattr(-,root,root)
%doc %{_docdir}/gpc/test_results
%changelog
* Wed Oct 19 2022 trevorbl@localhost
- modify check test results to acount for invalid results file
* Tue Aug 20 2013 trevorbl@localhost
- check test results, return fail if not enough tests passed
* Wed May 2 2012 trevorbl@localhost
- create initial version
############################# end of gpc-test.spec #######################