Add compatibility with macOS
Fixes #5
- Running
find_map_test_cases.pywas 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.
-
findcommand was not working, so I added if statement that checks if the platform is macOS and uses a different syntax. -
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. -
The default value for the
--grammarargument 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. -
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.
@microsoft-github-policy-service agree