cairo_native
cairo_native copied to clipboard
Better support for scarb
We can currently run Cairo tests through native with out cairo-native-test command in this repo.
It would be even better to one day be able to run tests driven scarb through native, so anyone managing their Cairo project with it could for example do scarb test --with-native.
A plan to integrate with scarb and see what changes it would require here would be the first step. A plan on modifications to scarb would be the second.
Here is the output of the research, first step would be to add a scarb-native-test binary which would be the same as running scarb test but with native execution. Here is the current implementation flow of scarb test:
- Running
scarb testwill by default direct test execution to thescarb-cairo-testbinary here. - Tests are filtered based on package filtering and test filtering.
- Matched tests are executed using the
TestCompilationstructure.
From the above we can:
- Reuse the same args as them for matching of the tests based on package filtering and test filtering (similar to what is done in
cairo-native-test). - Execute the tests in a similar fashion as done with the
cairo-native-testbinary which also makes use of theTestCompilationstructure to execute compiled test cases. In the case of scarb, we will just iterate every matchedTestCompilation.