Net--RabbitMQ
Net--RabbitMQ copied to clipboard
Compile & test fixes for Solaris 9/perl 5.8.7 (SPARC)
I will be the first to admit that I am doing something strange and unusual, for which I will make no apology. However, I did have to do a couple things to get Net::RabbitMQ 0.2.6 working on Solaris 9 with perl 5.8.7 (SPARC).
The most dubious change (and outside the realm of Net::RabbitMQ's responsibility) is faking <stdint.h>
on the system by symlinking it.
That is to say:
# ln -s /usr/include/sys/inttypes.h /usr/include/stdint.h
The second thing to do was fix-up the test headers.
--- 013_headers.t Fri Jul 13 15:35:59 2012
+++ 013_headers.t.works Tue Oct 23 15:30:29 2012
@@ -37,18 +37,18 @@
is($@, '', "drain queue");
my $headers = {
- abc => 123,
+ abc => '123',
def => 'xyx',
- head3 => 3,
- head4 => 4,
- head5 => 5,
- head6 => 6,
- head7 => 7,
- head8 => 8,
- head9 => 9,
- head10 => 10,
- head11 => 11,
- head12 => 12,
+ head3 => '3',
+ head4 => '4',
+ head5 => '5',
+ head6 => '6',
+ head7 => '7',
+ head8 => '8',
+ head9 => '9',
+ head10 => '10',
+ head11 => '11',
+ head12 => '12',
};
eval { $mq->publish( 1, "nr_test_route", "Header Test",
{ exchange => "nr_test_x" },
For some reason passing integers to the header makes them come back out as 0 in the test. Since strings work (see the "def" key) that should be sufficient for my needs, although at the time of this writing I have not written my application so this requirement may change.
Here is the failing (unpatched) test output which is corrected by the above patch.
# PERL_DL_NONLAZY=1 /usr/local/bin/perl -W "-MExtUtils::Command::MM" "-e" "test_
harness(0, 'blib/lib', 'blib/arch')" t/013_headers.t
Use of uninitialized value in scalar assignment at /usr/local/lib/perl5/5.8.7/TAP/Parser/Iterator/Process.pm line
84.
Subroutine IPC::Open3::xclose redefined at /usr/local/lib/perl5/5.8.7/TAP/Parser/Iterator/Process.pm line 147.
t/013_headers.t .. 3/20
# Failed test 'Received headers'
# at t/013_headers.t line 71.
# Structures begin differing at:
# $got->{head12} = '0'
# $expected->{head12} = '12'
# {
# 'body' => 'Header Test',
# 'consumer_tag' => 'ctag',
# 'delivery_tag' => '',
# 'exchange' => 'nr_test_x',
# 'props' => {
# 'headers' => {
# 'abc' => 0,
# 'def' => 'xyx',
# 'head10' => 0,
# 'head11' => 0,
# 'head12' => 0,
# 'head3' => 0,
# 'head4' => 0,
# 'head5' => 0,
# 'head6' => 0,
# 'head7' => 0,
# 'head8' => 0,
# 'head9' => 0
# }
# },
# 'routing_key' => 'nr_test_route'
# }
# Looks like you failed 1 test of 20.
t/013_headers.t .. Dubious, test returned 1 (wstat 256, 0x100)
Failed 1/20 subtests
(less 3 skipped subtests: 16 okay)
Test Summary Report
-------------------
t/013_headers.t (Wstat: 256 Tests: 20 Failed: 1)
Failed test: 14
Non-zero exit status: 1
Files=1, Tests=20, 1 wallclock secs ( 0.11 usr 0.03 sys + 0.17 cusr 0.06 csys = 0.37 CPU)
Result: FAIL
Failed 1/1 test programs. 1/20 subtests failed.