Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
43
third-party/vendor/tracy-client-sys/tests.rs
vendored
Normal file
43
third-party/vendor/tracy-client-sys/tests.rs
vendored
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
#[cfg(all(feature = "enable", test))]
|
||||
mod tests {
|
||||
use tracy_client_sys::*;
|
||||
|
||||
fn test_emit_zone() {
|
||||
unsafe {
|
||||
let srcloc = ___tracy_source_location_data {
|
||||
name: b"name\0".as_ptr().cast(),
|
||||
function: b"function\0".as_ptr().cast(),
|
||||
file: b"file\0".as_ptr().cast(),
|
||||
line: 42,
|
||||
color: 0,
|
||||
};
|
||||
let zone_ctx = ___tracy_emit_zone_begin(&srcloc, 1);
|
||||
___tracy_emit_zone_end(zone_ctx);
|
||||
}
|
||||
}
|
||||
|
||||
fn test_emit_message_no_null() {
|
||||
unsafe {
|
||||
___tracy_emit_message(b"hello world".as_ptr().cast(), 11, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/// Cannot use a libtest harness here because we need manual control over the profiler startup and
|
||||
/// shutdown.
|
||||
pub(crate) fn main() {
|
||||
unsafe {
|
||||
___tracy_startup_profiler();
|
||||
}
|
||||
test_emit_zone();
|
||||
test_emit_message_no_null();
|
||||
unsafe {
|
||||
___tracy_fiber_enter(b"hello".as_ptr().cast());
|
||||
___tracy_shutdown_profiler();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
fn main() {
|
||||
#[cfg(all(feature = "enable", test))]
|
||||
tests::main()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue