mozilla/mentat

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

Open

#276 aberto em 9 de fev. de 2017

Ver no GitHub
 (1 comment) (0 reactions) (0 assignees)Rust (116 forks)github user discovery
A-ednenhancementhelp wantedhygieneready

Métricas do repositório

Stars
 (1.661 stars)
Métricas de merge de PR
 (Métricas PR pendentes)

Description

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.

Guia do colaborador