Skip to content

Commit

Permalink
selftest: pass location of perl executable from waf to test-envs
Browse files Browse the repository at this point in the history
Many perl scripts in the codebase are executables with a
"/usr/bin/perl" shebang. Running them as executables is not
portable as some OS's have a different location for the perl
interpreter.

During the configuration process, waf finds the location of the perl
interpreter. Some or all  invocations of perl scripts from within
test environment setup code are actually "$PERL <script>",
but since PERL env var is typically not set, this amounts to the
unportable "<script>", which invokes /usr/bin/perl.

This patch exports the location of perl as found by the configuration
process to the test environment, causing "$PERL <script>" to be
"<correct place of perl interpreter> <script>".

Signed-off-by: Uri Simchoni <[email protected]>
Reviewed-by: Andrew Bartlett <[email protected]>
  • Loading branch information
urisimchoni authored and abartlet committed Dec 22, 2017
1 parent c4919d4 commit abcc955
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions selftest/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,9 @@ def cmd_testonly(opt):
# tell build system where to find config.h
os.environ['CONFIG_H'] = 'bin/default/include/config.h'

# tell the test system where perl is
os.environ['PERL'] = env.PERL

st_done = os.path.join(env.SELFTEST_PREFIX, 'st_done')
if os.path.exists(st_done):
os.unlink(st_done)
Expand Down

0 comments on commit abcc955

Please sign in to comment.