Hello Monks,
I'm writing tests for a program that accesses an Oracle database. When I run the tests directly or using prove, the tests work wonderfully. When I build the distribution (using Dist::Zilla) and run tests from the generated makefile, they fail:
Could not connect to ... : install_driver(Oracle) failed: Can't load ... Library not loaded: @rpath/libclntsh.dylib.12.1
It must be an environment issue (I'm running OS X), but I have not been able to crack it via the usual endless googling. I think there may be some way to get the appropriate variables set via Dist::Zilla using the D::Z::P::MakeMaker::Awesome, but I shelved that effort in favor of hacking something that works at all to begin with.
I tried setting the Oracle %ENV variables (dumped from my local environment where it works) within the problematic test using a BEGIN block, but still no luck...
BEGIN {
$ENV{ORACLE_HOME}="somepathto/oracle";
$ENV{DYLD_LIBRARY_PATH}="somepathto/oracle/lib";
}
Any ideas?
Thanks!
UPDATE:
I also tried unsetting the environment variables from within the test that works when I run it directly:
BEGIN{
`export DYLD_LIBRARY_PATH=""`;
`export ORACLE_HOME=""`;
`export LD_LIBRARY_PATH=""`;
$ENV{DYLD_LIBRARY_PATH}='';
$ENV{ORACLE_HOME}=''
$ENV{LD_LIBRARY_PATH}='';
}
The test still works!!!!
I'm only able to make the test crash during the "make test" phase. This is curious...
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.