diff --git a/mozilla/tools/release/t/Bootstrap/Step/Dummy.pm b/mozilla/tools/release/t/Bootstrap/Step/Dummy.pm new file mode 100644 index 00000000000..87b71c9eb1c --- /dev/null +++ b/mozilla/tools/release/t/Bootstrap/Step/Dummy.pm @@ -0,0 +1,70 @@ +package t::Bootstrap::Step::Dummy; +use Bootstrap::Step; +@ISA = ("Bootstrap::Step"); + +sub Execute { + my $this = shift; + + my $productTag = $this->Config('var' => 'productTag'); + + if (not $productTag) { + print("testfailed, could not get productTag var from Config: $!\n"); + } + + eval { + $this->Shell( 'cmd' => 'true' ); + }; + + if ($@) { + print("testfailed, shell call to true should not throw exception: $!\n"); + } + + eval { + $this->Shell( 'cmd' => 'false' ); + }; + + if (not $@) { + print("testfailed, shell call to false should throw exception: $!\n"); + } + + eval { + $this->CheckLog( + 'log' => './t/test.log', + 'checkForOnly' => '^success', + ); + }; + + if (not $@) { + print("testfailed, should throw exception, log contains more than success: $!\n"); + } + eval { + $this->CheckLog( + 'log' => './t/test.log', + 'checkForOnly' => '^success', + ); + }; + + if (not $@) { + print("testfailed, should throw exception, log contains more than success: $!\n"); + } + + eval { + $this->CheckLog( + 'log' => './t/test.log', + 'checkFor' => '^success', + ); + }; + + if ($@) { + print("testfailed, should throw exception, log contains success: $!\n"); + } + +} + +sub Verify { + my $this = shift; + $this->Shell('cmd' => 'echo Verify tag'); + $this->Log('msg' => 'finished'); +} + +1; diff --git a/mozilla/tools/release/t/test.log b/mozilla/tools/release/t/test.log new file mode 100644 index 00000000000..d55e6edad75 --- /dev/null +++ b/mozilla/tools/release/t/test.log @@ -0,0 +1,4 @@ +success +failed +success +failed diff --git a/mozilla/tools/release/t/test.pl b/mozilla/tools/release/t/test.pl new file mode 100755 index 00000000000..719e08e1633 --- /dev/null +++ b/mozilla/tools/release/t/test.pl @@ -0,0 +1,9 @@ +#!/usr/bin/perl -w +use strict; +use Bootstrap::Step; +use t::Bootstrap::Step::Dummy; + +my $step = t::Bootstrap::Step::Dummy->new(); + +$step->Execute(); +$step->Verify();