Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
[workspace]
members = ["cli-player", "lib"]
members = ["cli-player", "conformance-tests", "lib"]
resolver = "2"
9 changes: 2 additions & 7 deletions cli-player/tests/basic_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,8 @@ use std::{
fn basic_story_test() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("binkplayer")?;

let mut path = Path::new("inkfiles/test1.ink.json").to_path_buf();

// Due to a bug with Cargo workspaces, for Release mode the current folder is
// the crate folder and for Debug mode the current folder is the root folder.
if !path.exists() {
path = Path::new("../").join(path);
}
let path =
Path::new(env!("CARGO_MANIFEST_DIR")).join("../conformance-tests/inkfiles/test1.ink.json");

cmd.arg(path);
cmd.stdin(Stdio::piped());
Expand Down
9 changes: 2 additions & 7 deletions cli-player/tests/test_the_intercept.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ use std::{
fn the_intercept_test() -> Result<(), Box<dyn std::error::Error>> {
let mut cmd = Command::cargo_bin("binkplayer")?;

let mut path = Path::new("inkfiles/TheIntercept.ink.json").to_path_buf();

// Due to a bug with Cargo workspaces, for Release mode the current folder is
// the crate folder and for Debug mode the current folder is the root folder.
if !path.exists() {
path = Path::new("../").join(path);
}
let path = Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../conformance-tests/inkfiles/TheIntercept.ink.json");

cmd.arg(path);
cmd.stdin(Stdio::piped());
Expand Down
9 changes: 9 additions & 0 deletions conformance-tests/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[package]
name = "conformance-tests"
version = "0.1.0"
edition = "2021"
publish = false

[dependencies]
bladeink = { path = "../lib" }
rand = "0.9.2"
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,7 @@ pub fn run_story(
}

pub fn get_json_string(filename: &str) -> Result<String, Box<dyn Error>> {
let mut path = Path::new(filename).to_path_buf();

// Due to a bug with Cargo workspaces, for Release mode the current folder is the crate folder and for Debug mode the current folder is the root folder.
if !path.exists() {
path = Path::new("../").join(path);
}
let path = Path::new(env!("CARGO_MANIFEST_DIR")).join(filename);

let json = fs::read_to_string(path)?;
Ok(json)
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading