#!/usr/bin/perl
use strict;
use warnings;

use WWW::Selenium::Utils qw(generate_suite);
use Getopt::Long;

my $testdir;
my $quiet = 0;
my $base;
GetOptions( 
            'quiet'      => \$quiet,
            'base=s'     => \$base,
          ) or usage();
$testdir = shift;
usage("No tests directory provided!") unless $testdir;
usage("$testdir isn't a directory!") unless -d $testdir;

generate_suite( test_dir => $testdir,
                verbose => !$quiet,
                base_href => $base,
              );


sub usage {
    my $msg = shift || '';
    die <<EOT;
$msg
USAGE: $0 [options] /path/to/selenium/tests

Options:
 --quiet        Won't print informative output
 --base=<base>  Sets the base href for generated html files

This script will convert any .wiki files in the tests/ directory
to regular .html format selenium test files.  It will then put 
all tests/*.html files into tests/TestSuite.html

EOT
}
