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:
parent
b98293e21c
commit
50063749e2
1 changed files with 10 additions and 0 deletions
|
@ -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 {}
|
||||
|
|
Loading…
Reference in a new issue