I’m writing a parser for the Rust language. And I’d like to have a test suite (basically a comprehensive set of examples of valid and invalid rust code).
A first thought is to reuse tests from rustc. The problem is, there a a lot of tests in src/tests, and I am only interested in tests for parser. There is a nice directory called
tests/parse-fail, and what I would ideally like to have is
To specify it more formally, I want to extract the smallest number of test files, which cover the most of
libsyntax/parse/parser.rs. Any thoughts on how one may do this?
I guess I can run each test with coverage, and then solve a set cover problem, but it seems way too complicated: measuring coverage, running/building rust tests and solving an NP-hard problem are hard tasks even separately