Skip to content

Conversation

boraelci
Copy link

@boraelci boraelci commented May 3, 2023

Fixes #5

  1. Running find_map_test_cases.py was producing the following error:
OSError: dlopen(/Users/boraelci/methods2test/scripts/java-grammar.so, 0x0006): tried: '/Users/boraelci/methods2test/scripts/java-grammar.so' (not a mach-o file), '/usr/lib/java-grammar.so' (no such file)

I found out that the (not a mach-o file) part indicates an issue with macOS compatibility. I compiled the java language with tree-sitter using gcc -shared -o libtree-sitter-java.dylib -Isrc src/parser.c. I committed the resulting file, which should be passed into the --grammar argument when running the script on macOS. As a result, grammar file is loaded correctly.

  1. find command was not working, so I added if statement that checks if the platform is macOS and uses a different syntax.

  2. No tests_norm was being found in focals_norm. This is probably due to the different formats returned by grep in different platforms. I added an if statement that checks if the platform is macOS and removes the ./ from the beginning of the test file path.

  3. The default value for the --grammar argument was not working because it required an absolute path. I added an if statement that checks if the given path is not absolute, and in that case prefixes it with the absolute path of the current working directory.

  4. Fixed a few typos in README

I tested these changes on the hadoop repository. The tests are successfully identified and correctly mapped to classes and methods.

@boraelci
Copy link
Author

boraelci commented May 3, 2023

@microsoft-github-policy-service agree

@boraelci boraelci force-pushed the macos-compatibility branch from 2db782e to d40f8c2 Compare May 3, 2023 15:00
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.

Not compatible with macOS

1 participant