1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-25 15:29:32 -05:00

chore(tests): Friendlier message when running the tests and forgetting to run cargo build first. (#10901)

This commit is contained in:
David Sherret 2021-06-08 17:56:54 -04:00 committed by GitHub
parent b98293e21c
commit 50063749e2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,6 +132,15 @@ pub fn test_server_path() -> PathBuf {
p
}
fn ensure_test_server_built() {
// if the test server doesn't exist then remind the developer to build first
if !test_server_path().exists() {
panic!(
"Test server not found. Please cargo build before running the tests."
);
}
}
/// Benchmark server that just serves "hello world" responses.
async fn hyper_hello(port: u16) {
println!("hyper hello");
@ -1043,6 +1052,7 @@ impl Drop for HttpServerGuard {
/// last instance of the HttpServerGuard is dropped, the subprocess will be
/// killed.
pub fn http_server() -> HttpServerGuard {
ensure_test_server_built();
let mut g = lock_http_server();
g.inc();
HttpServerGuard {}