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

test 0152 fails: cut: tmp.log: No such file or directory #712

Open
ryandesign opened this issue Apr 5, 2024 · 1 comment
Open

test 0152 fails: cut: tmp.log: No such file or directory #712

ryandesign opened this issue Apr 5, 2024 · 1 comment

Comments

@ryandesign
Copy link
Contributor

Running regress/runtests on macOS, test 0152 fails this way:

Testing github-#0152: cut: tmp.log: No such file or directory
cut: tmp.log: No such file or directory
github-#0152/run: line 15: test: -eq: unary operator expected
failed (got  calls, and  failed)

So there are several problems:

  • First, tmp.log didn't get created for some reason.
  • Second, the test did not guard against that situation occurring.
  • Third, a syntax error occurred because you're not quoting your variables and they happened to be empty. shellcheck points this out:
In regress/github-#0152/run line 15:
if test $calls -eq 20 && test $failed -gt 0; then
        ^----^ SC2086 (info): Double quote to prevent globbing and word splitting.
                              ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean: 
if test "$calls" -eq 20 && test "$failed" -gt 0; then
@wdoekes
Copy link
Member

wdoekes commented Apr 29, 2024

shellcheck won't help here.

If there is no tmp.log then getting values out of it is useless. Doing "" -eq 20 makes as little sense as -eq 20.

(It would've been bad if the test succeeded though.)

I wouldn't mind a fix to the script, but more relevant is why there is no tmp.log in the first place.

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