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

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

my $testdir;
my $quiet = 0;
GetOptions( 
            'quiet'      => \$quiet,
          ) 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,
              );


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

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
}
