mirror of
https://github.com/servo/servo.git
synced 2025-07-27 01:00:41 +01:00
auto merge of #4048 : mttr/servo/mach_unit_test_fix, r=larsbergstrom
This is a quick and dirty workaround for issue #3928. Basically, `cargo test` is deleting `./target/servo`, which is clearly not ideal if we want to do anything with servo after running the unit tests. This PR makes sure to rebuild after running `./mach test-unit`. I'm not familiar enough with cargo yet to know why it's doing this or what better alternatives there are to fixing this. Having to rebuild afterwards feels pretty ugly to me, but my rationalization right now is that the time it takes to build is negligible in comparison to the time it takes to run the tests. Ideally, this should be something we could take care of in Cargo.toml, but again, I'm new to this (and the documentation seems less than helpful from what I can tell so far). I won't be available for the rest of the day, so if anyone has suggestions, or wants to wait for a better solution, I'll get back to it tomorrow probably. Otherwise, this PR at least makes `./mach test` work properly, so there's that.
This commit is contained in:
commit
f06e0a818d
1 changed files with 4 additions and 1 deletions
|
@ -87,7 +87,7 @@ class MachCommands(CommandBase):
|
|||
return self.infer_test_by_dir(params)
|
||||
|
||||
test_start = time()
|
||||
for t in ["tidy", "unit", "ref", "content", "wpt"]:
|
||||
for t in ["tidy", "ref", "content", "wpt", "unit"]:
|
||||
Registrar.dispatch("test-%s" % t, context=self.context)
|
||||
elapsed = time() - test_start
|
||||
|
||||
|
@ -121,6 +121,9 @@ class MachCommands(CommandBase):
|
|||
if c != "servo":
|
||||
ret = ret or cargo_test(c)
|
||||
|
||||
print("WARNING: test-unit has probably destroyed your servo binary "
|
||||
" (see https://github.com/rust-lang/cargo/issues/961 ). You "
|
||||
" may want to rebuild now.")
|
||||
return ret
|
||||
|
||||
@Command('test-ref',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue