mozilla/mentat

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

开放

#276 创建于 2017年2月9日

 (1 条评论) (0 个反应) (0 位负责人)Rust (116 个派生)github user discovery
A-ednenhancementhelp wantedhygieneready

仓库指标

星标
 (1,661 个星标)
PR 合并指标
 (30 天内没有已合并 PR)

描述

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.

贡献者指南