Skip to content

Commit

Permalink
Add integration tests
Browse files Browse the repository at this point in the history
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
  • Loading branch information
javierhonduco committed Jul 20, 2024
1 parent 75a9fbf commit af6ff56
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions tests/integration_test.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::process::{Command, Child};
use std::process::{Command, Child, Stdio};
use std::time::Duration;

use lightswitch::collector::Collector;
Expand Down Expand Up @@ -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()
}
Expand All @@ -58,6 +58,7 @@ impl Drop for TestProcess {
}
}


fn assert_any_stack_contains(
symbolized_profile: &SymbolizedAggregatedProfile,
expected_stack: &[&str],
Expand Down

0 comments on commit af6ff56

Please sign in to comment.