aboutsummaryrefslogtreecommitdiff
path: root/bin/test-website
diff options
context:
space:
mode:
Diffstat (limited to 'bin/test-website')
-rwxr-xr-xbin/test-website34
1 files changed, 30 insertions, 4 deletions
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
+