Skip to content

Commit

Permalink
Introduce more snapshots tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Dove6 committed Sep 13, 2024
1 parent f3f1548 commit 08948ba
Show file tree
Hide file tree
Showing 10 changed files with 40 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pixlib_parser/src/runner/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -939,6 +939,12 @@ impl CnvRunner {
y - graphics_offset.1 + window_offset.1,
)
.blend(pixel);
screenshot
.get_pixel_mut(
x - graphics_offset.0 + window_offset.0,
y - graphics_offset.1 + window_offset.1,
)
.0[3] = 255;
}
}
Ok((self.window_rect, screenshot.into_raw()))
Expand Down
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
OBJECT=CANVAS_OBSERVER
CANVAS_OBSERVER:TYPE=CANVAS_OBSERVER

OBJECT=TEST_ANIMATION
TEST_ANIMATION:TYPE=ANIMO
TEST_ANIMATION:FILENAME=TEST.ANN
TEST_ANIMATION:VISIBLE=TRUE
TEST_ANIMATION:TOCANVAS=TRUE

OBJECT=TIMEXIT
TIMEXIT:TYPE=TIMER
TIMEXIT:ELAPSE=100
TIMEXIT:ONTICK^1={ /
CANVAS_OBSERVER^SAVE("..\..\..\..\OUTPUT\OUT.IMG", 1, 1, 0, 0, 800, 600); /
TESTAPP^EXIT(); /
}
Binary file not shown.
Empty file.
Empty file.
17 changes: 17 additions & 0 deletions pixlib_parser/src/tests/basic_animation/dane/application.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
OBJECT=TESTAPP
TESTAPP:TYPE=APPLICATION
TESTAPP:VERSION=1.0.0
TESTAPP:PATH=APP
TESTAPP:EPISODES=TESTEP
TESTAPP:STARTWITH=TESTEP

OBJECT=TESTEP
TESTEP:TYPE=EPISODE
TESTEP:PATH=APP\EP
TESTEP:SCENES=TESTSCENE
TESTEP:STARTWITH=TESTSCENE

OBJECT=TESTSCENE
TESTSCENE:TYPE=SCENE
TESTSCENE:PATH=APP\EP\SCN
TESTSCENE:BACKGROUND=WHITE.IMG
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions pixlib_parser/src/tests/snapshot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ static OUTPUT_DIR_PATH: &str = "output";

#[test_case("basic_structure", &["OUT.ARR"])]
#[test_case("basic_image", &["OUT.IMG"])]
#[test_case("basic_animation", &["OUT.IMG"])]
#[ignore = "To be run separately"]
fn run_snapshot_test(dir_path: &str, snapshot_files: &[&str]) {
env_logger::try_init().ok_or_error();
Expand Down

0 comments on commit 08948ba

Please sign in to comment.