realchonk / fuse-ufs

FUSE driver for FreeBSD's UFSv2
BSD 2-Clause "Simplified" License
7 stars 3 forks source link

add big-endian image #36

Closed realchonk closed 3 months ago

realchonk commented 3 months ago

Created on my PowerMac

asomers commented 3 months ago

Are you planning to add the BE image to the test suite? You can use rstest to parameterize each test function, and run all of them on each image.

realchonk commented 3 months ago

yes, but I have not looked into how rstest works.

asomers commented 3 months ago

I just pushed a commit that parameterizes all tests on both images.

realchonk commented 3 months ago

Could you please reset --hard and do in on #37? I changed the testing a little

asomers commented 3 months ago

Could you please reset --hard and do in on #37? I changed the testing a little

What do you want me to do in #37 exactly? Are you suggesting that we use the test! macro instead of rstest's #[apply()]? IMHO test! is much less legible.

realchonk commented 3 months ago

Could you please reset --hard and do in on #37? I changed the testing a little

What do you want me to do in #37 exactly? Are you suggesting that we use the test! macro instead of rstest's #[apply()]? IMHO test! is much less legible.

After looking into rstest a little more, I agree with you. I just tried to reduce boilerplate, because I needed to do something like thi for every function:

#[rstest]
#[case(42, "FortyTwo", ("minus twelve", -12))]
#[case(24, "TwentyFour", ("minus twentyfour", -24))]
#[trace] //This attribute enable tracing
fn should_fail(#[case] number: u32, #[case] name: &str, #[case] tuple: (&str, i32)) {
    assert!(false); // <- stdout come out just for failed tests
}
realchonk commented 3 months ago

These test cases should start working once #24 is merged.

realchonk commented 3 months ago

I think I broke something by rebasing. I'm not sure how to fix this:

error: Wrong case signature: should match the given parameters list.
   --> tests/integration.rs:153:12
    |
153 | #[case::le(harness(GOLDEN_LE.as_path()))]
    |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
253 | #[apply(all_images)]
    | -------------------- in this procedural macro expansion
    |
    = note: this error originates in the macro `all_images` which comes from the expansion of the attribute macro `apply` (in Nightly builds, run with -Z macro-backtrace for more info)
realchonk commented 3 months ago

Fixed it, I forgot to add #[case]