Skip to content

Commit

Permalink
Initial integration of llvm-profparser
Browse files Browse the repository at this point in the history
Integration was as easy as expected, now I just need to finish
llvm-profparser off...
  • Loading branch information
xd009642 committed Nov 9, 2021
1 parent 84b2b83 commit d52e284
Show file tree
Hide file tree
Showing 3 changed files with 133 additions and 7 deletions.
123 changes: 120 additions & 3 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 5 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ path = "tests/mod.rs"

[dependencies]
cargo_metadata = "0.14"
cfg-if = "1.0.0"
chrono = "0.4"
clap = "2.33.3"
coveralls-api = "0.5.0"
Expand All @@ -30,8 +31,7 @@ git2 = "0.13"
humantime-serde = "1"
indexmap = { version = "1.7.0", features = ["serde-1"] }
lazy_static = "1.0"
tracing = { version = "0.1", default-features = false }
tracing-subscriber = {version = "0.2.25", default-features = false, features = ["env-filter", "fmt", "chrono", "ansi", "smallvec", "tracing-log"]}
llvm_profparser = { version = "0.1.0-alpha1", default-features = false }
memmap = "0.7.0"
object = "0.24"
proc-macro2 = { version = "1.0", features = ["span-locations"] }
Expand All @@ -41,10 +41,11 @@ regex = "1.4"
rustc-demangle = "0.1.21"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
syn = { version = "1.0", features = ["full"]}
syn = { version = "1.0", features = ["full"] }
toml = "0.5"
tracing = { version = "0.1", default-features = false }
tracing-subscriber = { version = "0.2.25", default-features = false, features = ["env-filter", "fmt", "chrono", "ansi", "smallvec", "tracing-log"] }
walkdir = "2.3.2"
cfg-if = "1.0.0"

[target.'cfg(target_os = "linux")'.dependencies]
libc = "0.2.94"
Expand Down
8 changes: 8 additions & 0 deletions src/statemachine/instrumented.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use crate::process_handling::RunningProcessHandle;
use crate::source_analysis::LineAnalysis;
use crate::statemachine::*;
use crate::TestHandle;
use llvm_profparser::*;
use std::collections::HashMap;
use std::ffi::OsStr;
use std::fs;
Expand Down Expand Up @@ -88,6 +89,13 @@ impl<'a> StateData for LlvmInstrumentedData<'a> {
for prof in &profraws {
info!("Generated: {}", self.config.strip_base_dir(prof).display());
}

let binary_path = parent.path.clone();

let instrumentation = merge_profiles(&profraws)?;
// Panics due to a todo!();
let _mapping = CoverageMapping::new(&[binary_path], &instrumentation);

self.process = None;
let code = exit.code().unwrap_or(1);
Ok(Some(TestState::End(code)))
Expand Down

0 comments on commit d52e284

Please sign in to comment.