mirror of
https://github.com/a-b-street/abstreet.git
synced 2024-11-24 01:15:12 +03:00
easily watch logs as a slow test runs
This commit is contained in:
parent
dacd423080
commit
56d3c81d82
@ -12,6 +12,8 @@ import sys
|
||||
arg = sys.argv[1]
|
||||
if arg.startswith('http://most/'):
|
||||
os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'most ' + arg[len('http://most/'):]])
|
||||
if arg.startswith('http://tail/'):
|
||||
os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'tail -f ' + arg[len('http://tail/'):]])
|
||||
elif arg.startswith('http://ui/'):
|
||||
os.execvp('urxvt', ['urxvt', '-e', 'sh', '-c', 'cd ~/abstreet/editor; cargo run ' + arg[len('http://ui/'):]])
|
||||
else:
|
||||
|
@ -60,6 +60,9 @@ out: replace accel_to_follow with something to warp to the right spot behind an
|
||||
agent and set the speed equal to min(follower's max speed, lead vehicle's
|
||||
current speed).
|
||||
|
||||
- do we have a bug where vehicles can be too close when they're on adjacent but different traversables?
|
||||
- if we just warp to follow_dist away from a vehicle when we get too close, then we instantly decelerate.
|
||||
|
||||
## The software engineering question
|
||||
|
||||
Is there a reasonable way to maintain both models and use one headless/editor
|
||||
|
@ -133,9 +133,6 @@ impl TestRunner {
|
||||
}
|
||||
}
|
||||
|
||||
print!("Running {}...", test_name);
|
||||
std::io::stdout().flush().unwrap();
|
||||
|
||||
let start = std::time::Instant::now();
|
||||
let mut helper = TestHelper {
|
||||
debug_with_savestate: None,
|
||||
@ -144,6 +141,21 @@ impl TestRunner {
|
||||
std::fs::create_dir_all(std::path::Path::new(&output_path).parent().unwrap())
|
||||
.expect("Creating parent dir failed");
|
||||
|
||||
if self.flags.clickable_links {
|
||||
print!(
|
||||
"Running {}... {}",
|
||||
test_name,
|
||||
Paint::cyan(&format!("http://tail/{}", output_path))
|
||||
);
|
||||
} else {
|
||||
print!(
|
||||
"Running {}... {}",
|
||||
test_name,
|
||||
Paint::cyan(&format!("tail -f {}", output_path))
|
||||
);
|
||||
}
|
||||
std::io::stdout().flush().unwrap();
|
||||
|
||||
let pass = {
|
||||
let _stdout_redirect = Redirect::stdout(
|
||||
std::fs::OpenOptions::new()
|
||||
|
Loading…
Reference in New Issue
Block a user