Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions crates/cli/src/go_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,9 @@ pub struct GoTestEvent {
pub output: Option<String>,
/// `build-*` events name the package here, not in `package`.
pub import_path: Option<String>,
/// `attr` events carry a key/value.
pub key: Option<String>,
pub value: Option<String>,
}

pub struct TestRun {
Expand Down
5 changes: 4 additions & 1 deletion crates/cli/src/handlers/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use crate::lock::acquire_target_lock;
use crate::workspace::WorkspaceBindgen;
use diagnostics::render::{self, Filter};
use lisette::fs::{LocalFileSystem, prune_orphan_go_files};
use lisette::pipeline::{CompileConfig, CompilePhase, TestIndex, compile};
use lisette::pipeline::{CompileConfig, CompilePhase, Sources, TestIndex, compile};

pub fn emit(path: Option<String>, sourcemap: bool) -> i32 {
with_locked_project(path, |prep| {
Expand Down Expand Up @@ -167,13 +167,15 @@ pub(super) struct BuildOptions {
pub(super) struct BuildOutcome {
pub code: i32,
pub test_index: TestIndex,
pub sources: Sources,
}

impl BuildOutcome {
fn failed(code: i32) -> Self {
Self {
code,
test_index: TestIndex::default(),
sources: Sources::default(),
}
}
}
Expand Down Expand Up @@ -427,6 +429,7 @@ pub(super) fn build_locked(prep: &BuildPrep, options: BuildOptions) -> BuildOutc
BuildOutcome {
code: 0,
test_index: result.test_index,
sources: result.sources,
}
}

Expand Down
5 changes: 4 additions & 1 deletion crates/cli/src/handlers/test/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ pub fn test(path: Option<String>, go_flags: Vec<String>) -> i32 {
&run.events,
&prep.manifest.project.name,
);
eprint!("{}", render(&report, use_color(), started.elapsed()));
eprint!(
"{}",
render(&report, &outcome.sources, use_color(), started.elapsed())
);

let build_error = report.build_output.trim();
if !build_error.is_empty() {
Expand Down
Loading
Loading