From 4fe625b9a42b003e31329edd45d087b9c47ef5ed Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 27 Dec 2013 23:50:01 +0000 Subject: tests: document and check for ab(1) dependency ab(1) is less common than our other dependencies, so allow tests to run without it. --- test/helper.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test/helper.rb') diff --git a/test/helper.rb b/test/helper.rb index ae22e7f..a841f20 100644 --- a/test/helper.rb +++ b/test/helper.rb @@ -119,6 +119,14 @@ def cloexec_pipe IO.pipe.each { |io| io.close_on_exec = true } end +def require_exec(cmd) + ENV["PATH"].split(/:/).each do |path| + return true if File.executable?("#{path}/#{cmd}") + end + skip "#{cmd} not found in PATH" + false +end + require 'yahns' # needed for parallel (MT) tests) -- cgit v1.2.3-24-ge0c7