#2 add ci testing with test subpackage
Opened 2 months ago by nhorman. Modified 2 months ago
rpms/ nhorman/cscope ci-onboard  into  f30

Add ci tests for cscope
Neil Horman • 2 months ago  
Add citest subpackage
Neil Horman • 2 months ago  
file modified
+36 -3

@@ -1,7 +1,7 @@ 

  Summary: C source code tree search and browse tool 

  Name: cscope

  Version: 15.9

- Release: 3%{?dist}

+ Release: 4%{?dist}

  Source0: https://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.gz

  URL: http://cscope.sourceforge.net

  License: BSD and GPLv2+

@@ -26,9 +26,17 @@ 

  Results are returned in lists, from which the user can select individual 

  matches for use in file editing.

  

+ %package citest

+ Summary: Fedora ci test subpackage for %{name}

+ Requires: %{name} = %{version}-%{release}

+ Requires: make pkgconf-pkg-config ncurses-devel flex bison m4

+ Requires: autoconf automake

+ 

+ %description citest

+ ci test package for cscope

+ 

  %prep

  %setup -q

- 

  autoreconf

  

  %build

@@ -49,8 +57,26 @@ 

    touch $RPM_BUILD_ROOT$dir/xcscope.elc

    echo "%ghost $dir/xcscope.el*" >> %{name}-%{version}.files

  done

+ mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{name}/citests/

+ cp -r * $RPM_BUILD_ROOT%{_datadir}/%{name}/citests/

+ cat >> $RPM_BUILD_ROOT%{_datadir}/%{name}/citests/runci.sh << EOF

+ #!/bin/sh

+ cd %{_datadir}/%{name}/citests

+ export CSCOPE_BINARY=/usr/bin/cscope

+ cd %{_datadir}/%{name}/citests/tests

+ for j in \$(ls check*.sh)

+ do

+ 	./\$j

+ 	if [ \$? -ne 0 ]

+ 	then

+ 		echo "\$j:"

+ 		cat ./\$j.log

+ 		exit 1

+ 	fi

+ done

  

- 

+ EOF

+ chmod 755 $RPM_BUILD_ROOT%{_datadir}/%{name}/citests/runci.sh

  

  %files -f %{name}-%{version}.files

  %{_bindir}/*

@@ -60,6 +86,10 @@ 

  %dir /var/lib/cs

  %doc AUTHORS COPYING ChangeLog README TODO contrib/cctree.txt

  

+ %files citest

+ %{_datadir}/%{name}/citests/

+ 

+ 

  %if !0%{?rhel}

  %triggerin -- xemacs

  ln -sf %{cscope_share_path}/xcscope.el %{xemacs_lisp_path}/xcscope.el

@@ -86,6 +116,9 @@ 

  rm -f %{vim_plugin_path}/cctree.vim

  

  %changelog

+ * Fri Jul 05 2019 Neil Horman <nhorman@tuxdriver.com> - 15.9-4

+ - Setup CI with test subpackages

+ 

  * Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 15.9-3

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

  

@@ -0,0 +1,3 @@ 

+ #!/bin/bash

+ exec /usr/share/cscope/rhelcitests/runci.sh

+ 

file added
+7

@@ -0,0 +1,7 @@ 

+ - hosts: localhost

+   tags:

+   - classic

+   roles:

+   - role: standard-test-basic

+     tests:

+     - smoke

Getting CI setup for cscope, which requires cscope sources in the test environment. I've setup a POC to do this with a test subpackage generated at build time.