From af6ff56ac2379408aaae61651bc1649423b241d4 Mon Sep 17 00:00:00 2001 From: Francisco Javier Honduvilla Coto Date: Sat, 20 Jul 2024 15:14:07 +0100 Subject: [PATCH] Add integration tests Starting with C++ binaries. This work leverages the nix build system to build the test programs [0] and executes them while running the profiler to ensure the traces are what we expect. [0]: https://github.com/javierhonduco/lightswitch-testprogs --- tests/integration_test.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tests/integration_test.rs b/tests/integration_test.rs index 69db266..3beb9e1 100644 --- a/tests/integration_test.rs +++ b/tests/integration_test.rs @@ -1,4 +1,4 @@ -use std::process::{Command, Child}; +use std::process::{Command, Child, Stdio}; use std::time::Duration; use lightswitch::collector::Collector; @@ -40,8 +40,8 @@ impl TestProcess { fn new(target: &str) -> Self{ Self { child: Command::new(format!("./target/nix/bin/{}", target)) - .stdout(std::process::Stdio::null()) - .stderr(std::process::Stdio::null()) + .stdout(Stdio::null()) + .stderr(Stdio::null()) .spawn() .unwrap() } @@ -58,6 +58,7 @@ impl Drop for TestProcess { } } + fn assert_any_stack_contains( symbolized_profile: &SymbolizedAggregatedProfile, expected_stack: &[&str],