Skip to content

Conversation

@moulins
Copy link
Contributor

@moulins moulins commented Nov 29, 2025

(Requires PR #22348)

Instead of treating any error or panic as a success, only "expected" failures are allowed, and the kind of check that should fail must be specified:

  • root-level known_failure = true: means that the final trace output check is expected to fail;
  • root-level known_failure.panic = "msg": means that the test is expected to panic (like the #[should_panic = "msg"] attribute in Rust unit tests);
  • image_comparisons.NAME.known_failure = true: means that the given image check is expected to fail.

@moulins moulins added A-tests Area: Tests & Test Framework T-feature Type: New Feature (that Flash doesn't have) labels Nov 29, 2025
@moulins moulins force-pushed the test-known-failure-explicit branch 2 times, most recently from f5cbf1d to 061a46d Compare November 29, 2025 17:58
@moulins moulins added the waiting-on-review Waiting on review from a Ruffle team member label Nov 29, 2025
@Dinnerbone
Copy link
Contributor

Tests in --release now fail (I do this a lot, it's faster to test in release 😅)

It's because we expect on e.g. overflow panic message, but those don't exist in release.

        FAIL [   0.234s] tests::tests [!] avm1/bitmap_data_thorough/pixelDissolve
        FAIL [   0.067s] tests::tests [!] from_gnash/misc-ming.all/get_frame_number_test
        FAIL [   0.075s] tests::tests [!fp10] from_gnash/misc-swfc.all/matrix_accuracy_test1
        FAIL [   0.057s] tests::tests [!fp9] from_gnash/misc-swfc.all/matrix_accuracy_test1

@moulins moulins force-pushed the test-known-failure-explicit branch from 4b9b3d4 to 9f0469d Compare November 29, 2025 22:23
@moulins
Copy link
Contributor Author

moulins commented Nov 29, 2025

Added a commit to skip panicky tests if debug assertions are disabled; it's a little heavy-handed, as some panicky tests hit regular assertions, but we have few enough of those that I don't think it's a big deal.

This'll make it easier to tweak it in the future.
Tests that are expected to panic are now required to explicitely say so
in their `test.toml`, by using `known_failure.panic = "expected message"`.

Additionally, only panics raised during player ticking are caught, and not those
happenning elsewhere (e.g. in rendering, or in test framework code).
Root-level `known_failure = true` now only except the trace output check to
fail; if other checks (e.g. image comparisons) are expected to fail, they should
specify their own `known_failure = true`.

num_frames = 1
known_failure = true # https://github.com/ruffle-rs/ruffle/issues/12123
known_failure = true # https://github.com/ruffle-rs/ruffle/issues/12118
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was there a reason for this comment to change? #12118 seems to be about acid-shapes-testing

}

fn visit_bool<E: de::Error>(self, v: bool) -> Result<Self::Value, E> {
Ok(match v {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: Could this just be an if-statement?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-tests Area: Tests & Test Framework T-feature Type: New Feature (that Flash doesn't have) waiting-on-review Waiting on review from a Ruffle team member

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants