-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
56 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,6 +11,7 @@ authors = [ | |
"Sven-Hendrik Haase <[email protected]>", | ||
"Simon Heath <[email protected]>", | ||
] | ||
# TODO: Uncomment this before release? | ||
edition = "2018" | ||
license = "MIT" | ||
readme = "README.md" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
|
||
extern crate ggez; | ||
use ggez::*; | ||
|
||
use std::env; | ||
use std::path; | ||
|
||
// TODO: Is there a good way to dedupe this? | ||
fn make_context() -> (Context, event::EventsLoop) { | ||
let mut cb = ContextBuilder::new("ggez_unit_tests", "ggez"); | ||
if let Ok(manifest_dir) = env::var("CARGO_MANIFEST_DIR") { | ||
let mut path = path::PathBuf::from(manifest_dir); | ||
path.push("resources"); | ||
cb = cb.add_resource_path(path); | ||
} | ||
cb.build().unwrap() | ||
} | ||
|
||
#[test] | ||
fn image_encode() { | ||
let (c, _e) = &mut make_context(); | ||
let image = graphics::Image::new(c, "/player.png").unwrap(); | ||
image.encode(c, graphics::ImageFormat::Png, "/encode_test.png").unwrap(); | ||
} | ||
|
||
|
||
#[test] | ||
fn save_screenshot() { | ||
let (c, _e) = &mut make_context(); | ||
let screenshot = graphics::screenshot(c).unwrap(); | ||
// screenshot.encode(c, graphics::ImageFormat::Png, "/screenshot_test.png").unwrap(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters