From e8f8ea6e97b901bfdd9b3c55bd99c30b6638f85f Mon Sep 17 00:00:00 2001 From: Nick Furfaro Date: Mon, 14 Feb 2022 16:02:35 -0700 Subject: [PATCH] Minimal viable test harness for the stdlib (#37) * config:update gitignore to ignore all tagket dirs * feat:add working demo of test harness * fix:add modules * Add new demo_script_test project * build:update dep versions in manifest files * fix:update code in mod and main * fix:change author email * fixup * fix:use local path to ttest current stdlib * test:remove dummy test * cleanup:remove dummy tests in prep for merge * style:cargo fmt --- .gitignore | 2 +- tests/Cargo.toml | 22 ++++++++++++++++++++++ tests/Forc.toml | 9 +++++++++ tests/tests/harness.rs | 2 ++ 4 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tests/Cargo.toml create mode 100644 tests/Forc.toml create mode 100644 tests/tests/harness.rs diff --git a/.gitignore b/.gitignore index 088ba6ba7d3..a853f476bed 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,6 @@ # Generated by Cargo # will have compiled files and executables -/target/ +**/target/ # Remove Cargo.lock from gitignore if creating an executable, leave it for libraries # More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html diff --git a/tests/Cargo.toml b/tests/Cargo.toml new file mode 100644 index 00000000000..05305fedf53 --- /dev/null +++ b/tests/Cargo.toml @@ -0,0 +1,22 @@ +[package] +authors = ["Fuel Labs "] +edition = "2021" +license = "Apache-2.0" +name = "tests" +version = "0.1.0" + +[dependencies] +fuel-gql-client = { version = "0.2", default-features = false } +fuel-tx = "0.2.0" +fuels-abigen-macro = "0.3" +fuels-contract = "0.3" +fuels-core = "0.3" +fuel-core = "0.3.1" +fuel-types = "0.1" +rand = "0.8" +tokio = { version = "1.12", features = ["rt", "macros"] } + +[[test]] +harness = true +name = "integration_tests" +path = "tests/harness.rs" diff --git a/tests/Forc.toml b/tests/Forc.toml new file mode 100644 index 00000000000..4844484d2fe --- /dev/null +++ b/tests/Forc.toml @@ -0,0 +1,9 @@ +[project] +author = "Fuel Labs " +entry = "main.sw" +license = "Apache-2.0" +name = "tests" + +[dependencies] +core = { git = "http://github.com/FuelLabs/sway-lib-core" } +std = { path = "../src" } diff --git a/tests/tests/harness.rs b/tests/tests/harness.rs new file mode 100644 index 00000000000..0f909cd9664 --- /dev/null +++ b/tests/tests/harness.rs @@ -0,0 +1,2 @@ +// Manually add tests to run here, ie: +// mod foo;