#!/usr/bin/perl -w # # Commandline Options: # # -f - Force: run the test in non-interactive mode # # -u - User: username to use when submitting jobs to TORQUE # use strict; use warnings; use Test::Harness; use Getopt::Std; print '-' x 21, "\n", "- TORQUE Test Suite -\n", '-' x 21, "\n\n"; our ($opt_f, $opt_u) = (undef, undef); getopts('fu:'); $ENV{'TORQUE_TEST_USER'} = $opt_u if defined $opt_u; if (defined $opt_f) { # Non-Interactive Mode print "* Non-Interactive Mode *\n\n"; } else { # Interactive Mode print "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n" . "* This test suite attempts to verify that the TORQUE install is *\n" . "* complete and configured correctly. As part of the test jobs will *\n" . "* be submitted to TORQUE for execution. One test will attempt to *\n" . "* start a job on every processor in your cluster. This can take *\n" . "* some time, depending on the size of your cluster. *\n" . "* *\n" . "* This prompt can be bypassed by using the -f commandline flag. *\n" . "* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *\n\n"; my $cont = ''; while ($cont !~ /^[YN]$/) { print 'Continue [y/N] '; $cont = uc ; chomp $cont; $cont = 'N' unless length $cont; } exit unless 'Y' eq $cont; } my $dir = 't/'; opendir DIR, $dir or die "Cannot open test directory: $!"; my @tests = sort grep { /^$dir\d\d_\w+\.t$/ } map { s/[\r\n]//g; "$dir$_" } readdir DIR; closedir DIR; runtests(@tests);