mirror of
https://github.com/aljazceru/kata-containers.git
synced 2026-01-08 08:54:29 +01:00
Add "coverage" target to compute code coverage for dragonball. Fixes: #7284 Signed-off-by: xuejun-xj <jiyunxue@linux.alibaba.com>
54 lines
1.1 KiB
Makefile
54 lines
1.1 KiB
Makefile
# Copyright (c) 2019-2022 Alibaba Cloud. All rights reserved.
|
|
# Copyright (c) 2019-2022 Ant Group. All rights reserved.
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
include ../../utils.mk
|
|
|
|
ifeq ($(ARCH), s390x)
|
|
default build check test clippy:
|
|
@echo "s390x not support currently"
|
|
exit 0
|
|
else
|
|
|
|
default: build
|
|
|
|
build:
|
|
@echo "INFO: cargo build..."
|
|
cargo build --all-features --target $(TRIPLE)
|
|
|
|
static-checks-build:
|
|
@echo "INFO: static-checks-build do nothing.."
|
|
|
|
check: clippy format
|
|
|
|
clippy:
|
|
@echo "INFO: cargo clippy..."
|
|
cargo clippy --all-targets --all-features \
|
|
-- \
|
|
-D warnings
|
|
|
|
vendor:
|
|
@echo "INFO: vendor do nothing.."
|
|
|
|
format:
|
|
@echo "INFO: cargo fmt..."
|
|
cargo fmt -- --check
|
|
|
|
clean:
|
|
cargo clean
|
|
|
|
test:
|
|
ifdef SUPPORT_VIRTUALIZATION
|
|
RUST_BACKTRACE=1 cargo test --all-features --target $(TRIPLE) -- --nocapture --test-threads=1
|
|
else
|
|
@echo "INFO: skip testing dragonball, it need virtualization support."
|
|
exit 0
|
|
endif
|
|
|
|
coverage:
|
|
RUST_BACKTRACE=1 cargo llvm-cov --all-features --target $(TRIPLE) -- --nocapture --test-threads=1
|
|
|
|
endif # ifeq ($(ARCH), s390x)
|
|
|
|
.DEFAULT_GOAL := default
|