cairo_native icon indicating copy to clipboard operation
cairo_native copied to clipboard

Better support for scarb

Open igaray opened this issue 1 year ago • 1 comments

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.

igaray avatar May 15 '24 16:05 igaray

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 test will by default direct test execution to the scarb-cairo-test binary here.
  • Tests are filtered based on package filtering and test filtering.
  • Matched tests are executed using the TestCompilation structure.

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-test binary which also makes use of the TestCompilation structure to execute compiled test cases. In the case of scarb, we will just iterate every matched TestCompilation.

greged93 avatar May 17 '24 17:05 greged93