From 90cd529668f6f122bacf28a86b31e96be932c4be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADt=20Ondruch?= Date: Sun, 13 Dec 2015 19:36:58 +0100 Subject: [PATCH] Move the ABRT hook test into separate file. --- ruby.spec | 18 ++++++++++-------- test_abrt.rb | 7 +++++++ 2 files changed, 17 insertions(+), 8 deletions(-) create mode 100644 test_abrt.rb diff --git a/ruby.spec b/ruby.spec index 702f6c4..daaf449 100644 --- a/ruby.spec +++ b/ruby.spec @@ -86,6 +86,8 @@ Source9: rubygems.req Source10: rubygems.prov # SystemTap sanity test case. 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 # 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 %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, # when abrt.rb cannot be required (seems to be easier way then customizing # the test suite). 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" %post libs -p /sbin/ldconfig diff --git a/test_abrt.rb b/test_abrt.rb new file mode 100644 index 0000000..6d110ba --- /dev/null +++ b/test_abrt.rb @@ -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