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

Make test runner script a little more resiliant #1117

Merged
merged 6 commits into from
Dec 6, 2024

Conversation

erooke
Copy link
Contributor

@erooke erooke commented Dec 5, 2024

  1. Use /usr/bin/env bash instead of /bin/bash as /bin/bash is not guaranteed to exist
  2. Use $(...) not `...` for command substitution. `...` is old and has lots of undefined behavior.
  3. Move print error to the top. In bash functions must be defined before they are called. print_error
    was defined after its call site resulting in an error when called.
  4. $@ is ambiguous, $* explicitly produces the behavior we are relying on.

In bash functions must be defined before they are called. `print_error`
was defined after its call site resulting in an error when called
In bash `$@` is an array. Doing `x=$@` is assigning an array to a
string. Different shells handle this differently. `$*` is explicit about
wanting to concatenate the array to a list which is the behavior we are
currently relying on.

https://www.shellcheck.net/wiki/SC2124
@daniel-larraz daniel-larraz merged commit f783c33 into kind2-mc:develop Dec 6, 2024
4 checks passed
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

Successfully merging this pull request may close these issues.

2 participants