-
Notifications
You must be signed in to change notification settings - Fork 16
Expand file tree
/
Copy pathMakefile
More file actions
87 lines (68 loc) · 2.31 KB
/
Copy pathMakefile
File metadata and controls
87 lines (68 loc) · 2.31 KB
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
curdir:=tests
OPENWRT_CI_TESTS = \
$(curdir)/x86-64 \
$(curdir)/armsr-armv8 \
$(curdir)/malta-be \
$(curdir)/shell
test: $(OPENWRT_CI_TESTS)
TESTSDIR ?= $(shell readlink -f $(TOPDIR)/tests)
define pytest
uv --project $(TESTSDIR) run \
pytest $(TESTSDIR)/tests/ \
--lg-log \
--log-cli-level=CONSOLE \
--lg-colored-steps $(if $(K),-k $(K),)
endef
$(curdir)/setup:
@[ -n "$$(command -v uv)" ] || \
(echo "Please install uv. See https://docs.astral.sh/uv/" && exit 1)
@[ -n "$$(command -v qemu-system-mips)" ] || \
(echo "Please install qemu-system-mips" && exit 1)
@[ -n "$$(command -v qemu-system-x86_64)" ] || \
(echo "Please install qemu-system-x86_64" && exit 1)
@[ -n "$$(command -v qemu-system-aarch64)" ] || \
(echo "Please install qemu-system-aarch64" && exit 1)
@uv --project $(TESTSDIR) sync
$(curdir)/x86-64: QEMU_BIN ?= qemu-system-x86_64
$(curdir)/x86-64: FIRMWARE ?= $(TOPDIR)/bin/targets/x86/64/openwrt-x86-64-generic-squashfs-combined.img.gz
$(curdir)/x86-64:
[ -f $(FIRMWARE) ]
gzip \
--force \
--keep \
--decompress \
$(FIRMWARE) || true
LG_QEMU_BIN=$(QEMU_BIN) \
$(pytest) \
--lg-env $(TESTSDIR)/targets/qemu_x86-64.yaml \
--firmware $(FIRMWARE:.gz=)
# LibreMesh x86-64 target with vwifi support for mesh simulation
$(curdir)/x86-64-libremesh: QEMU_BIN ?= qemu-system-x86_64
$(curdir)/x86-64-libremesh: FIRMWARE ?= $(TOPDIR)/bin/targets/x86/64/libremesh-x86-64-generic-squashfs-combined.img.gz
$(curdir)/x86-64-libremesh:
[ -f $(FIRMWARE) ]
gzip \
--force \
--keep \
--decompress \
$(FIRMWARE) || true
LG_QEMU_BIN=$(QEMU_BIN) \
$(pytest) \
--lg-env $(TESTSDIR)/targets/qemu_libremesh-x86-64.yaml \
--firmware $(FIRMWARE:.gz=)
$(curdir)/armsr-armv8: QEMU_BIN ?= qemu_system-aarch64
$(curdir)/armsr-armv8: FIRMWARE ?= $(TOPDIR)/bin/targets/armsr/armv8/openwrt-armsr-armv8-generic-initramfs-kernel.bin
$(curdir)/armsr-armv8:
[ -f $(FIRMWARE) ]
LG_QEMU_BIN=$(QEMU_BIN) \
$(pytest) \
--lg-env $(TESTSDIR)/targets/qemu_armsr-armv8.yaml \
--firmware $(FIRMWARE)
$(curdir)/malta-be: QEMU_BIN ?= qemu-system-mips
$(curdir)/malta-be: FIRMWARE ?= $(TOPDIR)/bin/targets/malta/be/openwrt-malta-be-vmlinux-initramfs.elf
$(curdir)/malta-be:
[ -f $(FIRMWARE) ]
LG_QEMU_BIN=$(QEMU_BIN) \
$(pytest) \
--lg-env $(TESTSDIR)/targets/qemu_malta-be.yaml \
--firmware $(FIRMWARE)