aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrian Cully <bjc@kublai.com>2017-11-12 19:46:30 -0500
committerBrian Cully <bjc@kublai.com>2017-11-12 20:04:21 -0500
commitd85845e9e5aa2bf76dcf76d972e18142697d3e92 (patch)
tree4beececada53c3f3de3811b244abb8b6f541bece
parent0290ddc5c456681ba1a28c44dc988aadb6daddb3 (diff)
downloadxmpt-d85845e9e5aa2bf76dcf76d972e18142697d3e92.tar.gz
xmpt-d85845e9e5aa2bf76dcf76d972e18142697d3e92.zip
Add -l option to require libraries during eval.
-rw-r--r--xml/presence.expected.xml1
-rw-r--r--xml/presence.xml1
-rwxr-xr-xxmpt21
3 files changed, 14 insertions, 9 deletions
diff --git a/xml/presence.expected.xml b/xml/presence.expected.xml
new file mode 100644
index 0000000..24a67d9
--- /dev/null
+++ b/xml/presence.expected.xml
@@ -0,0 +1 @@
+<presence from='{full_jid}' to='{full_jid}'/>
diff --git a/xml/presence.xml b/xml/presence.xml
new file mode 100644
index 0000000..1087406
--- /dev/null
+++ b/xml/presence.xml
@@ -0,0 +1 @@
+<presence/>
diff --git a/xmpt b/xmpt
index 19451f2..e1f19ee 100755
--- a/xmpt
+++ b/xmpt
@@ -11,19 +11,21 @@ use warnings;
our $VERSION = '0';
+my $verbose;
my $configpath = 'localhost.conf';
+my $timeout = 5;
my $testplanpath = 'testplan';
my $templatepath = 'xml';
-my $timeout = 5;
-my $verbose;
+my @libs;
my $help;
-GetOptions('config|c=s' => \$configpath,
- 'testplan|p=s' => \$testplanpath,
- 'templates|d=s' => \$templatepath,
- 'timeout|t=i' => \$timeout,
- 'verbose|v' => \$verbose,
- 'help|h' => \$help) || usage(1);
+GetOptions('verbose|v' => \$verbose,
+ 'config|c=s' => \$configpath,
+ 'timeout|t=i' => \$timeout,
+ 'testplan|p=s' => \$testplanpath,
+ 'templates|d =s' => \$templatepath,
+ 'lib|l=s' => \@libs,
+ 'help|h' => \$help) || usage(1);
usage(0) if $help;
$| = 1;
@@ -49,7 +51,7 @@ waitpid($pid, 0) if $pid;
# TODO: swap over to Pod::Usage.
sub usage {
- print STDERR "Usage: $0 [-v] [-c config] [-p testplan] [-d templatedir] [-t seconds] [command]\n";
+ print STDERR "Usage: $0 [-hv] [-c config] [-t seconds] [-p testplan] [-d templatedir] [-l libpath] [command]\n";
exit shift;
}
@@ -164,6 +166,7 @@ sub eval_in {
}
eval {
+ package evalpkg { require $_ for @libs };
foreach my $plan (@plans) {
print STDERR "=> Executing $plan->{name} step.\n" if $verbose;
do_send($plan->{name}, @{$plan->{send}});