Integration is a go!

This commit is contained in:
Lucien Greathouse 2018-08-25 20:58:17 -07:00
parent 008f50efd7
commit ea02a5078d
14 changed files with 183 additions and 95 deletions

2
integration/.gitignore vendored Normal file
View file

@ -0,0 +1,2 @@
/target/
**/*.rs.bk

4
integration/Cargo.lock generated Normal file
View file

@ -0,0 +1,4 @@
[[package]]
name = "integration"
version = "0.1.0"

6
integration/Cargo.toml Normal file
View file

@ -0,0 +1,6 @@
[package]
name = "integration"
version = "0.1.0"
authors = ["Lucien Greathouse <me@lpghatguy.com>"]
[dependencies]

32
integration/src/main.rs Normal file
View file

@ -0,0 +1,32 @@
use std::{
path::Path,
process::Command,
thread,
time::Duration,
};
fn main() {
let plugin_path = Path::new("../plugin");
let server_path = Path::new("../server");
let tests_path = Path::new("../tests");
let server = Command::new("cargo")
.args(&["run", "--", "serve", "../test-projects/empty"])
.current_dir(server_path)
.spawn();
thread::sleep(Duration::from_millis(1000));
// TODO: Wait for server to start responding on the right port
let test_client = Command::new("lua")
.args(&["runTest.lua", "tests/empty.lua"])
.current_dir(plugin_path)
.spawn();
thread::sleep(Duration::from_millis(300));
// TODO: Collect output from the client for success/failure?
println!("Dying!");
}