Move the ABRT hook test into separate file.

This commit is contained in:
Vít Ondruch 2015-12-13 19:36:58 +01:00
parent fa57346f58
commit 90cd529668
2 changed files with 17 additions and 8 deletions

View File

@ -86,6 +86,8 @@ Source9: rubygems.req
Source10: rubygems.prov Source10: rubygems.prov
# SystemTap sanity test case. # SystemTap sanity test case.
Source11: test_systemtap.rb Source11: test_systemtap.rb
# ABRT hoook test case.
Source12: test_abrt.rb
# The load directive is supported since RPM 4.12, i.e. F21+. The build process # The load directive is supported since RPM 4.12, i.e. F21+. The build process
# fails on older Fedoras. # fails on older Fedoras.
@ -591,19 +593,19 @@ sed -e "s|@LIBRARY_PATH@|%{tapset_libdir}/libruby.so.%{major_minor_version}|" \
sed -i -r "s|( \*.*\*)\/(.*)|\1\\\/\2|" %{buildroot}%{tapset_dir}/libruby.so.%{major_minor_version}.stp sed -i -r "s|( \*.*\*)\/(.*)|\1\\\/\2|" %{buildroot}%{tapset_dir}/libruby.so.%{major_minor_version}.stp
%check %check
# Sanity check that SystemTap (dtrace) was detected.
make runruby TESTRUN_SCRIPT=%{SOURCE11}
# Check if abrt hook is required.
LD_LIBRARY_PATH=. RUBYOPT=-I.:lib:.ext/x86_64-linux/ ./ruby -d -e '' |& grep abrt
DISABLE_TESTS=""
# test_debug(TestRubyOptions) fails due to LoadError reported in debug mode, # test_debug(TestRubyOptions) fails due to LoadError reported in debug mode,
# when abrt.rb cannot be required (seems to be easier way then customizing # when abrt.rb cannot be required (seems to be easier way then customizing
# the test suite). # the test suite).
touch abrt.rb touch abrt.rb
# Sanity check that SystemTap (dtrace) was detected.
make runruby TESTRUN_SCRIPT=%{SOURCE11}
# Check if abrt hook is required.
make runruby TESTRUN_SCRIPT=%{SOURCE12}
DISABLE_TESTS=""
make check TESTS="-v $DISABLE_TESTS" make check TESTS="-v $DISABLE_TESTS"
%post libs -p /sbin/ldconfig %post libs -p /sbin/ldconfig

7
test_abrt.rb Normal file
View File

@ -0,0 +1,7 @@
if !!$LOADED_FEATURES.detect { |f| f =~ /abrt\.rb/ }
exit true
else
puts 'ERROR: ABRT hook was not loaded.'
exit false
end