summaryrefslogtreecommitdiff
path: root/test/dtrace/helper.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 04:39:09 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-11-29 04:39:09 +0000
commit5bb12509a2db64cb92fd52222fc2022c9181d54e (patch)
tree3b7a18a8c1121fcccd3fe243bef505f3fece5f10 /test/dtrace/helper.rb
parent0e515efda19c2ec15c61f623e097ecc4818fd561 (diff)
* test/dtrace/helper.rb (DTrace::TestCase): check dtrace availability
once. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@37969 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/dtrace/helper.rb')
-rw-r--r--test/dtrace/helper.rb7
1 files changed, 2 insertions, 5 deletions
diff --git a/test/dtrace/helper.rb b/test/dtrace/helper.rb
index ef691b5e32..2aea3d9d08 100644
--- a/test/dtrace/helper.rb
+++ b/test/dtrace/helper.rb
@@ -1,3 +1,4 @@
+# -*- coding: us-ascii -*-
require 'minitest/autorun'
require 'tempfile'
@@ -5,10 +6,6 @@ module DTrace
class TestCase < MiniTest::Unit::TestCase
INCLUDE = File.expand_path(File.join(File.dirname(__FILE__), '..'))
- def setup
- skip "must be setuid 0 to run dtrace tests" unless Process.euid == 0
- end
-
def trap_probe d_program, ruby_program
d = Tempfile.new('probe.d')
d.write d_program
@@ -30,4 +27,4 @@ module DTrace
yield(d_path, rb_path, probes)
end
end
-end
+end if Process.euid == 0 and (`dtrace -V` rescue false)