diff options
author | Pjotr Prins | 2016-04-28 08:55:45 +0000 |
---|---|---|
committer | Pjotr Prins | 2016-04-28 08:55:45 +0000 |
commit | a46be3cb631b3e1c7f76593a65a0ae1692c72fda (patch) | |
tree | a4aecd0a77573e47fa0605bb924d214e51bea466 | |
parent | 4d8da2a56ab315a28f0e296690f5ae5b09324615 (diff) | |
download | genenetwork2-a46be3cb631b3e1c7f76593a65a0ae1692c72fda.tar.gz |
Test: splitting out static URL tests
-rwxr-xr-x | bin/test-website | 34 |
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 + |