mozilla/mentat

[tests] Don't compile the test EDN into the test binary

Open

#276 geöffnet am 9. Feb. 2017

Auf GitHub ansehen
 (1 Kommentar) (0 Reaktionen) (0 zugewiesene Personen)Rust (116 Forks)github user discovery
A-ednenhancementhelp wantedhygieneready

Repository-Metriken

Stars
 (1.661 Stars)
PR-Merge-Metriken
 (PR-Metriken ausstehend)

Beschreibung

Right now, I'm using include_str! to get the EDN fixtures into our tests. However, this means any change to the test data prompts a recompile, which is slow!

This ticket tracks updating the code around https://github.com/mozilla/mentat/blob/9be487ca7d84416f71c8c77361c9483f7bccc88f/db/src/db.rs#L921 and https://github.com/mozilla/mentat/blob/9be487ca7d84416f71c8c77361c9483f7bccc88f/db/src/db.rs#L943 to instead only include_str! a single file listing the test fixture filenames, and then dynamically reading the test fixture contents at test time.

That'll make changes to the test list prompt a recompile, but otherwise make it fast to iterate on the test file itself.

Bonus points for using a build.rs snippet to expand the test list at compile time, generating functions for reach test file. That will produce better cargo test output than a single test that runs through all the test fixtures.

Contributor Guide