mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-04-20 12:45:05 +00:00
Replace rojo-test with regular tests folder again (#323)
* Replace rojo-test with regular tests folder again * Bump MSRV to 1.43.1
This commit is contained in:
committed by
GitHub
parent
ca5b8ab309
commit
5ccd02939b
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
@@ -12,7 +12,7 @@ jobs:
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
rust_version: [stable, "1.40.0"]
|
||||
rust_version: [stable, "1.43.1"]
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
19
Cargo.lock
generated
19
Cargo.lock
generated
@@ -1978,25 +1978,6 @@ dependencies = [
|
||||
"serde_yaml",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rojo-test"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"env_logger",
|
||||
"insta",
|
||||
"log",
|
||||
"paste",
|
||||
"rbx_dom_weak",
|
||||
"reqwest",
|
||||
"rojo",
|
||||
"rojo-insta-ext",
|
||||
"serde",
|
||||
"serde_json",
|
||||
"serde_yaml",
|
||||
"tempfile",
|
||||
"walkdir",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "rust-argon2"
|
||||
version = "0.7.0"
|
||||
|
||||
@@ -31,7 +31,6 @@ dev_live_assets = []
|
||||
|
||||
[workspace]
|
||||
members = [
|
||||
"rojo-test",
|
||||
"rojo-insta-ext",
|
||||
"clibrojo",
|
||||
"memofs",
|
||||
@@ -39,7 +38,6 @@ members = [
|
||||
|
||||
default-members = [
|
||||
".",
|
||||
"rojo-test",
|
||||
"rojo-insta-ext",
|
||||
"memofs",
|
||||
]
|
||||
|
||||
@@ -48,7 +48,7 @@ Check out our [contribution guide](CONTRIBUTING.md) for detailed instructions fo
|
||||
|
||||
Pull requests are welcome!
|
||||
|
||||
Rojo supports Rust 1.40.0 and newer. The minimum supported version of Rust is based on the latest versions of the dependencies that Rojo has.
|
||||
Rojo supports Rust 1.43.1 and newer. The minimum supported version of Rust is based on the latest versions of the dependencies that Rojo has.
|
||||
|
||||
## License
|
||||
Rojo is available under the terms of the Mozilla Public License, Version 2.0. See [LICENSE.txt](LICENSE.txt) for details.
|
||||
@@ -1,27 +0,0 @@
|
||||
[package]
|
||||
name = "rojo-test"
|
||||
version = "0.1.0"
|
||||
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
|
||||
edition = "2018"
|
||||
publish = false
|
||||
|
||||
[features]
|
||||
default = []
|
||||
|
||||
unstable_glob_ignore_paths = []
|
||||
|
||||
[dependencies]
|
||||
env_logger = "0.7.1"
|
||||
insta = { version = "0.13.1", features = ["redactions"] }
|
||||
log = "0.4.8"
|
||||
paste = "0.1.5"
|
||||
rbx_dom_weak = "1.9.0"
|
||||
reqwest = "0.9.20"
|
||||
serde = "1.0.99"
|
||||
serde_json = "1.0.40"
|
||||
serde_yaml = "0.8.9"
|
||||
tempfile = "3.1.0"
|
||||
walkdir = "2.2.9"
|
||||
|
||||
rojo = { path = ".." }
|
||||
rojo-insta-ext = { path = "../rojo-insta-ext" }
|
||||
@@ -1,8 +0,0 @@
|
||||
# rojo-test
|
||||
This project does end-to-end testing of Rojo by executing it and checking what side-effects it has.
|
||||
|
||||
rojo-test is meant to be run as a test with:
|
||||
|
||||
```bash
|
||||
cargo test
|
||||
```
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
source: tests/tests/build.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
@@ -1,12 +0,0 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="StringValue" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">plain</string>
|
||||
<string name="Value">This is a bare text file with no project.</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,11 +0,0 @@
|
||||
---
|
||||
source: rojo-test/src/build_test.rs
|
||||
expression: contents
|
||||
---
|
||||
<roblox version="4">
|
||||
<Item class="Folder" referent="0">
|
||||
<Properties>
|
||||
<string name="Name">plain_gitkeep</string>
|
||||
</Properties>
|
||||
</Item>
|
||||
</roblox>
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
|
||||
---
|
||||
messageCursor: 1
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
|
||||
---
|
||||
messageCursor: 1
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
|
||||
---
|
||||
messageCursor: 1
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
protocolVersion: 3
|
||||
rootInstanceId: id-2
|
||||
serverVersion: "[server-version]"
|
||||
sessionId: id-1
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
|
||||
---
|
||||
messageCursor: 1
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
@@ -0,0 +1,9 @@
|
||||
---
|
||||
source: tests/tests/serve.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
protocolVersion: 3
|
||||
rootInstanceId: id-2
|
||||
serverVersion: "[server-version]"
|
||||
sessionId: id-1
|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
source: tests/tests/serve.rs
|
||||
expression: "subscribe_response.intern_and_redact(&mut redactions, ())"
|
||||
---
|
||||
messageCursor: 1
|
||||
@@ -1,19 +0,0 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
expression: "read_response.intern_and_redact(&mut redactions, root_id)"
|
||||
---
|
||||
instances:
|
||||
id-2:
|
||||
Children: []
|
||||
ClassName: StringValue
|
||||
Id: id-2
|
||||
Metadata:
|
||||
ignoreUnknownInstances: false
|
||||
Name: just_txt
|
||||
Parent: ~
|
||||
Properties:
|
||||
Value:
|
||||
Type: String
|
||||
Value: "Hello, world!"
|
||||
messageCursor: 0
|
||||
sessionId: id-1
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
protocolVersion: 3
|
||||
rootInstanceId: id-2
|
||||
serverVersion: "[server-version]"
|
||||
sessionId: id-1
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
protocolVersion: 3
|
||||
rootInstanceId: id-2
|
||||
serverVersion: "[server-version]"
|
||||
sessionId: id-1
|
||||
@@ -1,9 +0,0 @@
|
||||
---
|
||||
source: rojo-test/src/serve_test.rs
|
||||
expression: redactions.redacted_yaml(info)
|
||||
---
|
||||
expectedPlaceIds: ~
|
||||
protocolVersion: 3
|
||||
rootInstanceId: id-2
|
||||
serverVersion: "[server-version]"
|
||||
sessionId: id-1
|
||||
@@ -1,7 +0,0 @@
|
||||
#![cfg(test)]
|
||||
|
||||
mod build_test;
|
||||
mod internable;
|
||||
mod serve_test;
|
||||
mod serve_util;
|
||||
mod util;
|
||||
2
tests/end_to_end.rs
Normal file
2
tests/end_to_end.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod rojo_test;
|
||||
mod tests;
|
||||
@@ -6,16 +6,9 @@ use std::{
|
||||
|
||||
use walkdir::WalkDir;
|
||||
|
||||
pub fn get_rojo_path() -> PathBuf {
|
||||
let working_dir = get_working_dir_path();
|
||||
|
||||
let mut exe_path = working_dir.join("target/debug/rojo");
|
||||
if cfg!(windows) {
|
||||
exe_path.set_extension("exe");
|
||||
}
|
||||
|
||||
exe_path
|
||||
}
|
||||
pub static ROJO_PATH: &str = env!("CARGO_BIN_EXE_rojo");
|
||||
pub static BUILD_TESTS_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/rojo-test/build-tests");
|
||||
pub static SERVE_TESTS_PATH: &str = concat!(env!("CARGO_MANIFEST_DIR"), "/rojo-test/serve-tests");
|
||||
|
||||
pub fn get_working_dir_path() -> PathBuf {
|
||||
let mut manifest_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR"));
|
||||
@@ -26,16 +19,6 @@ pub fn get_working_dir_path() -> PathBuf {
|
||||
manifest_dir
|
||||
}
|
||||
|
||||
pub fn get_build_tests_path() -> PathBuf {
|
||||
let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||
manifest_dir.join("build-tests")
|
||||
}
|
||||
|
||||
pub fn get_serve_tests_path() -> PathBuf {
|
||||
let manifest_dir = Path::new(env!("CARGO_MANIFEST_DIR"));
|
||||
manifest_dir.join("serve-tests")
|
||||
}
|
||||
|
||||
/// Recursively walk a directory and copy each item to the equivalent location
|
||||
/// in another directory. Equivalent to `cp -r src/* dst`
|
||||
pub fn copy_recursive(from: &Path, to: &Path) -> io::Result<()> {
|
||||
3
tests/rojo_test/mod.rs
Normal file
3
tests/rojo_test/mod.rs
Normal file
@@ -0,0 +1,3 @@
|
||||
pub mod internable;
|
||||
pub mod io_util;
|
||||
pub mod serve_util;
|
||||
@@ -14,8 +14,8 @@ use tempfile::{tempdir, TempDir};
|
||||
use librojo::web_api::{ReadResponse, ServerInfoResponse, SubscribeResponse};
|
||||
use rojo_insta_ext::RedactionMap;
|
||||
|
||||
use crate::util::{
|
||||
copy_recursive, get_rojo_path, get_serve_tests_path, get_working_dir_path, KillOnDrop,
|
||||
use crate::rojo_test::io_util::{
|
||||
copy_recursive, get_working_dir_path, KillOnDrop, ROJO_PATH, SERVE_TESTS_PATH,
|
||||
};
|
||||
|
||||
/// Convenience method to run a `rojo serve` test.
|
||||
@@ -38,7 +38,11 @@ pub fn run_serve_test(test_name: &str, callback: impl FnOnce(TestServeSession, R
|
||||
|
||||
let mut settings = insta::Settings::new();
|
||||
|
||||
let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("serve-test-snapshots");
|
||||
let snapshot_path = Path::new(SERVE_TESTS_PATH)
|
||||
.parent()
|
||||
.unwrap()
|
||||
.join("serve-test-snapshots");
|
||||
|
||||
settings.set_snapshot_path(snapshot_path);
|
||||
settings.set_sort_maps(true);
|
||||
settings.add_redaction(".serverVersion", "[server-version]");
|
||||
@@ -58,11 +62,9 @@ pub struct TestServeSession {
|
||||
|
||||
impl TestServeSession {
|
||||
pub fn new(name: &str) -> Self {
|
||||
let serve_test_path = get_serve_tests_path();
|
||||
let working_dir = get_working_dir_path();
|
||||
let exe_path = get_rojo_path();
|
||||
|
||||
let source_path = serve_test_path.join(name);
|
||||
let source_path = Path::new(SERVE_TESTS_PATH).join(name);
|
||||
let dir = tempdir().expect("Couldn't create temporary directory");
|
||||
let project_path = dir.path().join(name);
|
||||
|
||||
@@ -80,7 +82,7 @@ impl TestServeSession {
|
||||
let port = get_port_number();
|
||||
let port_string = port.to_string();
|
||||
|
||||
let rojo_process = Command::new(exe_path)
|
||||
let rojo_process = Command::new(ROJO_PATH)
|
||||
.args(&[
|
||||
"serve",
|
||||
project_path.to_str().unwrap(),
|
||||
@@ -3,7 +3,7 @@ use std::{fs, path::Path, process::Command};
|
||||
use insta::assert_snapshot;
|
||||
use tempfile::tempdir;
|
||||
|
||||
use crate::util::{get_build_tests_path, get_rojo_path, get_working_dir_path};
|
||||
use crate::rojo_test::io_util::{get_working_dir_path, BUILD_TESTS_PATH, ROJO_PATH};
|
||||
|
||||
macro_rules! gen_build_tests {
|
||||
( $($test_name: ident,)* ) => {
|
||||
@@ -56,17 +56,14 @@ gen_build_tests! {
|
||||
}
|
||||
|
||||
fn run_build_test(test_name: &str) {
|
||||
let build_test_path = get_build_tests_path();
|
||||
let working_dir = get_working_dir_path();
|
||||
|
||||
let input_path = build_test_path.join(test_name);
|
||||
let input_path = Path::new(BUILD_TESTS_PATH).join(test_name);
|
||||
|
||||
let output_dir = tempdir().expect("couldn't create temporary directory");
|
||||
let output_path = output_dir.path().join(format!("{}.rbxmx", test_name));
|
||||
|
||||
let exe_path = get_rojo_path();
|
||||
|
||||
let status = Command::new(exe_path)
|
||||
let status = Command::new(ROJO_PATH)
|
||||
.args(&[
|
||||
"build",
|
||||
input_path.to_str().unwrap(),
|
||||
@@ -84,7 +81,11 @@ fn run_build_test(test_name: &str) {
|
||||
|
||||
let mut settings = insta::Settings::new();
|
||||
|
||||
let snapshot_path = Path::new(env!("CARGO_MANIFEST_DIR")).join("build-test-snapshots");
|
||||
let snapshot_path = Path::new(BUILD_TESTS_PATH)
|
||||
.parent()
|
||||
.unwrap()
|
||||
.join("build-test-snapshots");
|
||||
|
||||
settings.set_snapshot_path(snapshot_path);
|
||||
|
||||
settings.bind(|| {
|
||||
2
tests/tests/mod.rs
Normal file
2
tests/tests/mod.rs
Normal file
@@ -0,0 +1,2 @@
|
||||
mod build;
|
||||
mod serve;
|
||||
@@ -3,7 +3,7 @@ use std::fs;
|
||||
use insta::assert_yaml_snapshot;
|
||||
use tempfile::tempdir;
|
||||
|
||||
use crate::{internable::InternAndRedact, serve_util::run_serve_test};
|
||||
use crate::rojo_test::{internable::InternAndRedact, serve_util::run_serve_test};
|
||||
|
||||
#[test]
|
||||
fn empty() {
|
||||
Reference in New Issue
Block a user