Libelektra: testshell_markdown should be disabled if `bash` is not available

Created on 15 Jun 2018  ·  5Comments  ·  Source: ElektraInitiative/libelektra

Steps to Reproduce the Problem

build and run ctest on a system without bash.

Expected Result

bash dependent tests are not executed

Actual Result

138/172 Test #134: testshell_markdown_issue_template ........***Failed    0.00 sec
env: can't execute 'bash': No such file or directory

System Information

  • Elektra Version: master
  • Operating System or Docker Container?
  • Versions of other relevant software?

Further Log Files and Output

https://build.libelektra.org/jenkins/blue/organizations/jenkins/libelektra/detail/PR-2063/52/pipeline/444

bug build

Most helpful comment

I will probably just rewrite the shell recorder wo work with sh...

All 5 comments

Thank you for reporting the problem!

As long term goal we want to get rid of bash, see #1938.

But excluding tests that need bash on a system without bash seems to be useful and not too much work. Greping for "env bash" it looks like the shell recorder is the only part which needs bash. So a check and if in add_msr_test should be enough.

I tried implementing it via find_program but that produced more exclusion messages as I liked (I wanted to print exactly 1 if bash could not be found)

I will probably just rewrite the shell recorder wo work with sh...

@sanssecours I am getting close now. But can you explain to me what happens here?

That part isn't even parsing for me on bash :X

EDIT: NVM got it, sorry for the ping

But can you explain to me what happens here?

This line uses a feature called process substitution to compare two “files” with diff. Anyway, you do not need to worry about that stuff, I already removed this code in pull request #2066. If you want you can just delete lines 135 till 145.

That part isn't even parsing for me on bash :X

Wikipedia states that this feature is quite old:

The Bash shell provided process substitution no later than version 1.14, released in 1994.

. Maybe you are using bash in sh-compatibility mode by specifying the hash bang #!/bin/sh:

cat <(echo bla)
#> bla
set -o posix
cat <(echo bla)
# STDERR: syntax error near unexpected token `('

?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

e1528532 picture e1528532  ·  4Comments

mpranj picture mpranj  ·  3Comments

mpranj picture mpranj  ·  3Comments

sanssecours picture sanssecours  ·  4Comments

dmoisej picture dmoisej  ·  3Comments