Add unit tests skeleton for the time profiler

This commit adds a test crate for the time profiler to `tests/unit/profile`. The
only unit test contained in this crate is a smoke test that the time profiler
thread can be created and destroyed. It serves as a place for adding new tests
in the future.
This commit is contained in:
Nick Fitzgerald 2016-04-19 16:27:35 -07:00
parent 64b0dafde8
commit 35a5d6da15
5 changed files with 51 additions and 0 deletions

View file

@ -0,0 +1,15 @@
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
use profile::time;
use profile_traits::time::ProfilerMsg;
#[test]
fn time_profiler_smoke_test() {
let chan = time::Profiler::create(None);
assert!(true, "Can create the profiler thread");
chan.send(ProfilerMsg::Exit);
assert!(true, "Can tell the profiler thread to exit");
}