From ea2d57edd391517384d534dd643c0991071d8b28 Mon Sep 17 00:00:00 2001 From: Paul Beckingham Date: Wed, 27 Jan 2010 22:54:40 -0500 Subject: [PATCH] Enhancements - Hooks - Make the hooks unit tests pass if Lua support is not included. We don't like yellow in the tinderbox. --- src/tests/hook.post-start.t | 14 +++++++++++--- src/tests/hook.pre-exit.t | 13 +++++++++++-- 2 files changed, 22 insertions(+), 5 deletions(-) diff --git a/src/tests/hook.post-start.t b/src/tests/hook.post-start.t index a9e83f0ee..cdd30516b 100755 --- a/src/tests/hook.post-start.t +++ b/src/tests/hook.post-start.t @@ -46,9 +46,17 @@ if (open my $fh, '>', 'hook') ok (-r 'hook', 'Created hook'); } -# Test the hook. -my $output = qx{../task rc:hook.rc _version}; -like ($output, qr/^marker.+\n\d\.\d+\.\d+\n$/ms, 'Found marker before output'); +my $output = qx{../task rc:hook.rc version}; +if ($output =~ /PUC-Rio/) +{ + # Test the hook. + $output = qx{../task rc:hook.rc _version}; + like ($output, qr/^marker.+\n\d\.\d+\.\d+\n$/ms, 'Found marker before output'); +} +else +{ + pass ('Found marker before output - skip: no Lua support'); +} # Cleanup. unlink 'pending.data'; diff --git a/src/tests/hook.pre-exit.t b/src/tests/hook.pre-exit.t index 9093a9719..07d2fa17b 100755 --- a/src/tests/hook.pre-exit.t +++ b/src/tests/hook.pre-exit.t @@ -47,8 +47,17 @@ if (open my $fh, '>', 'hook') } # Test the hook. -my $output = qx{../task rc:hook.rc _version}; -like ($output, qr/\n\d\.\d+\.\d+\nmarker\n$/ms, 'Found marker after output'); +my $output = qx{../task rc:hook.rc version}; +if ($output =~ /PUC-Rio/) +{ + # Test the hook. + $output = qx{../task rc:hook.rc _version}; + like ($output, qr/\n\d\.\d+\.\d+\nmarker\n$/ms, 'Found marker after output'); +} +else +{ + pass ('Found marker after output - skipping: no Lua support'); +} # Cleanup. unlink 'pending.data';