diff --git a/server/tests/web.rs b/server/tests/web.rs index 516a0bd8..103345b0 100644 --- a/server/tests/web.rs +++ b/server/tests/web.rs @@ -1,3 +1,5 @@ +#[macro_use] extern crate lazy_static; + extern crate rouille; extern crate serde_json; extern crate serde; @@ -22,13 +24,17 @@ use librojo::{ rbx::RbxValue, }; -#[test] -fn empty() { - let original_project_path = { +lazy_static! { + static ref TEST_PROJECTS_ROOT: PathBuf = { let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push("test-projects/empty"); + path.push("../test-projects"); path }; +} + +#[test] +fn empty() { + let original_project_path = TEST_PROJECTS_ROOT.join("empty"); let project_tempdir = tempfile::tempdir().unwrap(); let project_path = project_tempdir.path(); @@ -72,11 +78,7 @@ fn empty() { #[test] fn one_partition() { - let original_project_path = { - let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push("test-projects/one-partition"); - path - }; + let original_project_path = TEST_PROJECTS_ROOT.join("one-partition"); let project_tempdir = tempfile::tempdir().unwrap(); let project_path = project_tempdir.path(); @@ -394,11 +396,7 @@ fn one_partition() { #[test] fn partition_to_file() { - let original_project_path = { - let mut path = PathBuf::from(env!("CARGO_MANIFEST_DIR")); - path.push("test-projects/partition-to-file"); - path - }; + let original_project_path = TEST_PROJECTS_ROOT.join("partition-to-file"); let project_tempdir = tempfile::tempdir().unwrap(); let project_path = project_tempdir.path(); diff --git a/test-project/extra-script.lua b/test-project/extra-script.lua deleted file mode 100644 index e69de29b..00000000 diff --git a/test-project/rojo.json b/test-project/rojo.json deleted file mode 100644 index 3d7187b6..00000000 --- a/test-project/rojo.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name": "test-project", - "servePort": 34872, - "partitions": { - "src": { - "path": "src", - "target": "ReplicatedFirst" - }, - "extra": { - "path": "extra-script.lua", - "target": "ReplicatedStorage.ExtraScript" - } - } -} \ No newline at end of file diff --git a/test-project/src/SomeTool/SomeTool.client.lua b/test-project/src/SomeTool/SomeTool.client.lua deleted file mode 100644 index 9c537fc8..00000000 --- a/test-project/src/SomeTool/SomeTool.client.lua +++ /dev/null @@ -1 +0,0 @@ -print("Hello, world, from my tool!") \ No newline at end of file diff --git a/test-project/src/SomeTool/init.model.json b/test-project/src/SomeTool/init.model.json deleted file mode 100644 index 500c7bca..00000000 --- a/test-project/src/SomeTool/init.model.json +++ /dev/null @@ -1,4 +0,0 @@ -{ - "Name": "SomeTool", - "ClassName": "Tool" -} \ No newline at end of file diff --git a/test-project/src/a/b.lua b/test-project/src/a/b.lua deleted file mode 100644 index de385843..00000000 --- a/test-project/src/a/b.lua +++ /dev/null @@ -1 +0,0 @@ -print("HEY!") \ No newline at end of file diff --git a/test-project/src/bar.client.lua b/test-project/src/bar.client.lua deleted file mode 100644 index 7999f9b4..00000000 --- a/test-project/src/bar.client.lua +++ /dev/null @@ -1 +0,0 @@ --- bar.client.lua \ No newline at end of file diff --git a/test-project/src/foo.server.lua b/test-project/src/foo.server.lua deleted file mode 100644 index 66d1b30d..00000000 --- a/test-project/src/foo.server.lua +++ /dev/null @@ -1 +0,0 @@ --- foo.server.lua \ No newline at end of file diff --git a/test-project/src/hello.model.json b/test-project/src/hello.model.json deleted file mode 100644 index c0afd96f..00000000 --- a/test-project/src/hello.model.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "Name": "hello", - "ClassName": "Model", - "Children": [ - { - "Name": "Some Part", - "ClassName": "Part" - }, - { - "Name": "Some StringValue", - "ClassName": "StringValue", - "Properties": { - "Value": { - "Type": "String", - "Value": "Hello, world!" - } - } - } - ] -} \ No newline at end of file diff --git a/test-project/src/meh/init.lua b/test-project/src/meh/init.lua deleted file mode 100644 index e69de29b..00000000 diff --git a/test-project/src/meh/x.lua b/test-project/src/meh/x.lua deleted file mode 100644 index 79743485..00000000 --- a/test-project/src/meh/x.lua +++ /dev/null @@ -1 +0,0 @@ --- meh/x.lua \ No newline at end of file diff --git a/test-project/src/test.lua b/test-project/src/test.lua deleted file mode 100644 index 42f8349e..00000000 --- a/test-project/src/test.lua +++ /dev/null @@ -1 +0,0 @@ --- test.lua \ No newline at end of file diff --git a/server/test-projects/empty/rojo.json b/test-projects/empty/rojo.json similarity index 100% rename from server/test-projects/empty/rojo.json rename to test-projects/empty/rojo.json diff --git a/server/test-projects/one-partition/lib/a.lua b/test-projects/one-partition/lib/a.lua similarity index 100% rename from server/test-projects/one-partition/lib/a.lua rename to test-projects/one-partition/lib/a.lua diff --git a/server/test-projects/one-partition/lib/a.server.lua b/test-projects/one-partition/lib/a.server.lua similarity index 100% rename from server/test-projects/one-partition/lib/a.server.lua rename to test-projects/one-partition/lib/a.server.lua diff --git a/server/test-projects/one-partition/lib/b.client.lua b/test-projects/one-partition/lib/b.client.lua similarity index 100% rename from server/test-projects/one-partition/lib/b.client.lua rename to test-projects/one-partition/lib/b.client.lua diff --git a/server/test-projects/one-partition/rojo.json b/test-projects/one-partition/rojo.json similarity index 100% rename from server/test-projects/one-partition/rojo.json rename to test-projects/one-partition/rojo.json diff --git a/server/test-projects/partition-to-file/foo.lua b/test-projects/partition-to-file/foo.lua similarity index 100% rename from server/test-projects/partition-to-file/foo.lua rename to test-projects/partition-to-file/foo.lua diff --git a/server/test-projects/partition-to-file/rojo.json b/test-projects/partition-to-file/rojo.json similarity index 100% rename from server/test-projects/partition-to-file/rojo.json rename to test-projects/partition-to-file/rojo.json