Skip to content

Commit 960de68

Browse files
committed
kcov: Fix cmake command
Turns out cmake _always_ emits output in the current directory unless the build directory already exists.
1 parent 235ec02 commit 960de68

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

scripts/lib/kcov

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,11 @@ clone_and_build_kcov() {
8888

8989
@go.printf 'Building kcov...\n'
9090

91-
if ! cmake "$kcov_dir" || ! make -C "$kcov_dir"; then
92-
@go.printf 'Failed to build kcov.\n' >&2
93-
return 1
91+
if cd "$kcov_dir" >/dev/null && cmake . && make && cd - >/dev/null; then
92+
return
9493
fi
94+
@go.printf 'Failed to build kcov.\n' >&2
95+
return 1
9596
}
9697

9798
check_kcov_dev_packages_installed() {

tests/kcov.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,10 @@ write_kcov_go_script() {
8585
assert_success "apt-get install -y ${KCOV_DEV_PACKAGES[*]}"
8686

8787
run cat "$FAKE_BIN_DIR/cmake.out"
88-
assert_success 'tests/kcov'
88+
assert_success '.'
8989

9090
run cat "$FAKE_BIN_DIR/make.out"
91-
assert_success '-C tests/kcov'
91+
assert_success ''
9292
}
9393

9494
@test "$SUITE: clone and build fails if clone fails" {

0 commit comments

Comments
 (0)