From b3ffc2fef657bfea6c48fd6cc78a0658be946428 Mon Sep 17 00:00:00 2001 From: Vít Ondruch Date: Dec 13 2015 18:36:58 +0000 Subject: Move the ABRT hook test into separate file. --- diff --git a/ruby.spec b/ruby.spec index 697cd47..7c561a8 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 +# 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. -LD_LIBRARY_PATH=. RUBYOPT=-I.:lib:.ext/x86_64-linux/ ./ruby -d -e '' |& grep abrt +make runruby TESTRUN_SCRIPT=%{SOURCE12} 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 - 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