From a46be3cb631b3e1c7f76593a65a0ae1692c72fda Mon Sep 17 00:00:00 2001 From: Pjotr Prins Date: Thu, 28 Apr 2016 08:55:45 +0000 Subject: Test: splitting out static URL tests --- bin/test-website | 34 ++++++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/test-website b/bin/test-website index 8efa37b1..24274713 100755 --- a/bin/test-website +++ b/bin/test-website @@ -14,11 +14,30 @@ the root of the genenetwork2 source tree as, for example, For more information see http://genenetwork.org/ EOT +$stderr.print USAGE -libpath = File.dirname(File.dirname(__FILE__)) -$: << File.join(libpath,'test/lib') +require 'optparse' + +options = {} +opts = OptionParser.new do |o| + o.banner = "Usage: #{File.basename($0)} [options] URL" -$stderr.print USAGE + o.on('-l','--link-checker', 'Check for dead links') do + options[:link_checker] = true + end + + o.separator "" + o.on_tail('-h', '--help', 'display this help and exit') do + options[:show_help] = true + end +end + +opts.parse!(ARGV) + +if options[:show_help] + print opts + exit 1 +end $host = if ARGV.size>0 @@ -35,6 +54,13 @@ require 'minitest/autorun' # These are the actual testing modules -require 'main_web_functionality' +libpath = File.dirname(File.dirname(__FILE__)) +$: << File.join(libpath,'test/lib') +if options[:link_checker] + require 'link_checker' +else + require 'main_web_functionality' +end + -- cgit v1.2.3