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

retdec-tests-runner.sh on macOS prints "find: -executable: unknown primary or operator" and exits with 0 #238

Closed
s3rvac opened this issue Mar 5, 2018 · 1 comment

Comments

@s3rvac
Copy link
Member

s3rvac commented Mar 5, 2018

When running retdec-tests-runner.sh on macOS, it prints

Running all unit tests in retdec/install/bin ...
find: -executable: unknown primary or operator

The script then ends with return code 0 and no tests are run. This can be also seen on Travis CI (e.g. here). Since the script exits with 0, it causes the job to succeed even though it should have failed.

It is expected that the tests should run, e.g. retdec-tests-runner.sh on macOS should print

Running all unit tests in retdec/install/bin ...

retdec-tests-bin2llvmir
[  PASSED  ] 437 tests.

retdec-tests-capstone2llvmir
[  PASSED  ] 3069 tests.

...

Just like on Linux.

@s3rvac s3rvac self-assigned this Mar 5, 2018
s3rvac added a commit that referenced this issue Mar 5, 2018
On macOS, find does not support the '-executable' parameter (#238). Therefore,
on macOS, we have to use '-perm +111'. To explain, + means "any of these bits"
and 111 is the octal representation for the executable bit on owner, group, and
other. Unfortunately, we cannot use '-perm +111' on all systems because find on
Linux/MSYS2 does not support +. It supports only /, but this is not supported
by find on macOS... Hence, we need an if.
s3rvac added a commit that referenced this issue Mar 5, 2018
#238).

Previously, it exited with 0, which is undesirable.
@s3rvac
Copy link
Member Author

s3rvac commented Mar 5, 2018

Fixed in def3bcd. Also, in d28767d, I have updated the script to exit with 1 if not tests run. This is better than exiting with 0, which was the original behavior.

Details

As the error message from the issue description suggests, on macOS, find does not support the -executable parameter. Therefore, on macOS, we have to use -perm +111. To explain, + means "any of these bits" and 111 is the octal representation for the executable bit on owner, group, and other. Unfortunately, we cannot use -perm +111 on all systems because find on Linux/MSYS2 does not support +. It supports only /, but this is not supported by find on macOS... Hence, we need an if.

@s3rvac s3rvac closed this as completed Mar 5, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant