Skip to content

Commit

Permalink
Add Rust test run to build script
Browse files Browse the repository at this point in the history
  • Loading branch information
samstokes committed Nov 30, 2018
1 parent bf40771 commit d7ff3db
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 1 deletion.
11 changes: 10 additions & 1 deletion scripts/support/compile
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,11 @@ def stroller_build():
else:
return run_backend(start, build)

def stroller_test():
start = time.time()
return run_test(start,
"cd stroller && unbuffer cargo test")

def reload_server():
start = time.time()
global profile
Expand All @@ -209,6 +214,7 @@ class Should:
self.server_build = False
self.server_test = False
self.stroller_build = False
self.stroller_test = False
self.client2_install = False
self.client2_build = False
self.client2_test = False
Expand All @@ -227,6 +233,9 @@ def execute(should):

stb = should.stroller_build and stroller_build()

should.stroller_test |= stb
stt = should.stroller_test and stroller_test()

c2i = should.client2_install and client2_install ()
should.client2_build |= c2i
c2b = should.client2_build and client2_build()
Expand Down Expand Up @@ -259,7 +268,7 @@ def execute(should):
should.elm_test |= em
et = should.elm_test and elm_test()

return sb and stb and rs and ep and em and lc and rb and ot and etp and et and ge and c2b and c2t
return sb and stb and rs and ep and em and lc and rb and ot and etp and et and ge and c2b and stt and c2t



Expand Down
13 changes: 13 additions & 0 deletions stroller/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,16 @@ fn main() {

hyper::rt::run(server);
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn responds_ok() {
let req = Request::get("/ignored").body(Body::empty()).unwrap();
let resp = hello_world(req);

assert_eq!(resp.status(), 200);
}
}

0 comments on commit d7ff3db

Please sign in to comment.