-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathMakefile
35 lines (27 loc) · 998 Bytes
/
Makefile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
# For images and kernels, see https://github.com/danobi/vmtest/releases/tag/test_assets for available assets.
IMAGES := image-not-uefi.raw image-uefi.raw-efi
KERNELS := bzImage-v5.15-default bzImage-v6.2-default
ASSET_DIRECTORY := tests/.assets
IMAGES_FILES := $(foreach image,$(IMAGES),$(ASSET_DIRECTORY)/$(image))
KERNELS_FILES := $(foreach kernel,$(KERNELS),$(ASSET_DIRECTORY)/$(kernel))
.PHONY: all
all:
@cargo build
.PHONY: test
test: $(IMAGES_FILES) $(KERNELS_FILES)
@RUST_LOG=debug cargo test -- --test-threads=1 --nocapture
.PHONY: clean
clean:
@cargo clean
@rm -rf $(ASSET_DIRECTORY)
.PHONY: lint
lint:
@cargo clippy -- -D warnings
$(ASSET_DIRECTORY):
@mkdir -p $@
$(IMAGES_FILES): | $(ASSET_DIRECTORY)
@curl -q -L https://github.com/danobi/vmtest/releases/download/test_assets/$(notdir $@).zst -o [email protected]
@zstd -d [email protected] -o $@
$(KERNELS_FILES): | $(ASSET_DIRECTORY)
@curl -q -L https://github.com/danobi/vmtest/releases/download/test_assets/$(notdir $@) -o $@