diff --git a/components/servo/Cargo.lock b/components/servo/Cargo.lock index 70ece4ceb18..699fb329559 100644 --- a/components/servo/Cargo.lock +++ b/components/servo/Cargo.lock @@ -33,6 +33,7 @@ dependencies = [ "offscreen_gl_context 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)", "plugin_compiletest 0.0.1", "profile 0.0.1", + "profile_tests 0.0.1", "profile_traits 0.0.1", "script 0.0.1", "script_tests 0.0.1", @@ -1626,6 +1627,14 @@ dependencies = [ "util 0.0.1", ] +[[package]] +name = "profile_tests" +version = "0.0.1" +dependencies = [ + "profile 0.0.1", + "profile_traits 0.0.1", +] + [[package]] name = "profile_traits" version = "0.0.1" diff --git a/components/servo/Cargo.toml b/components/servo/Cargo.toml index f62468c5151..10e4573bb7c 100644 --- a/components/servo/Cargo.toml +++ b/components/servo/Cargo.toml @@ -33,6 +33,9 @@ path = "../../tests/unit/net" [dev-dependencies.net_traits_tests] path = "../../tests/unit/net_traits" +[dev-dependencies.profile_tests] +path = "../../tests/unit/profile" + [dev-dependencies.script_tests] path = "../../tests/unit/script" diff --git a/tests/unit/profile/Cargo.toml b/tests/unit/profile/Cargo.toml new file mode 100644 index 00000000000..812a304660d --- /dev/null +++ b/tests/unit/profile/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "profile_tests" +version = "0.0.1" +authors = ["The Servo Project Developers"] + +[lib] +name = "profile_tests" +path = "lib.rs" +doctest = false + +[dependencies.profile] +path = "../../../components/profile" + +[dependencies.profile_traits] +path = "../../../components/profile_traits" diff --git a/tests/unit/profile/lib.rs b/tests/unit/profile/lib.rs new file mode 100644 index 00000000000..f60883d4211 --- /dev/null +++ b/tests/unit/profile/lib.rs @@ -0,0 +1,9 @@ +/* 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/. */ + +extern crate profile; +extern crate profile_traits; + +#[cfg(test)] +mod time; diff --git a/tests/unit/profile/time.rs b/tests/unit/profile/time.rs new file mode 100644 index 00000000000..b3156f40f87 --- /dev/null +++ b/tests/unit/profile/time.rs @@ -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"); +}