Open
Description
Since the clarity version and epoch can be selected at runtime in using the TestEnvironment
struct, the test-clarity-vN
features requiring us to build the tests three different times (once for each clarity version) are unnecessary and should be replaced by better infrastructure.
One alternative is to introduce a procedural macro that takes in a test function and a version selection. The macro would generate code instantiating a TestEnvironment
using the selected version and injecting it into the function provided:
#[test_with_env(v1, v2)]
fn the_test(env: TestEnvironment) {
// test code
}
// expands into...
#[test]
fn the_test_v1() {
let env = TestEnvironment::new(/*version 1 and epoch*/)
// test code
}
#[test]
fn the_test_v2() {
let env = TestEnvironment::new(/*version 2 and epoch*/)
// test code
}
Metadata
Assignees
Type
Projects
Status
Status: 🆕 New
Activity