Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip a test program if ATF_SHELL is not found #177

Open
asomers opened this issue Feb 24, 2018 · 3 comments
Open

Skip a test program if ATF_SHELL is not found #177

asomers opened this issue Feb 24, 2018 · 3 comments

Comments

@asomers
Copy link
Member

asomers commented Feb 24, 2018

Test programs that aren't compatible with /bin/sh can specify a different shell using -s. For example:

#!/usr/libexec/atf-sh -s/usr/local/bin/ksh93

But if that shell is not found, then Kyua cannot list the test cases, and will report the test as broken. Instead, it should simply skip the entire test program.

@jmmv
Copy link
Member

jmmv commented Feb 27, 2018

There is nothing Kyua can do about this because Kyua should not be inspecting the contents of the test, much less playing heuristics with the shebang line.

I guess atf-sh could check for the existence of the file and then report something back to Kyua... But this is tricky: at that point we haven't even started processing the command line of the test program so we don't know where the results file is going to live. And trying to process the command line from there seems fragile.

You can avoid this by adding a required_programs entry to your Kyuafile and listing the shell there. Is that sufficient?

@asomers
Copy link
Member Author

asomers commented Feb 27, 2018

I tried that, but it doesn't work because Kyua will still try to list test cases. It seems that required_programs only affects whether a test case will be executed.

@jmmv
Copy link
Member

jmmv commented Feb 27, 2018

Oh I see. Yikes. There is no concept of skipping a whole test program during listing. Not sure how this ought to be fixed...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants