Skip to content
This repository was archived by the owner on Mar 7, 2021. It is now read-only.

Commit 39e5956

Browse files
committed
Attempt to fix tests
1 parent cc1080b commit 39e5956

File tree

3 files changed

+9
-1
lines changed

3 files changed

+9
-1
lines changed

hello-world/src/lib.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,5 @@ kernel_module!(
3232
HelloWorldModule,
3333
author: "Alex Gaynor and Geoffrey Thomas",
3434
description: "An extremely simple kernel module",
35-
license: "GPL"
35+
__module_license_string: "GPL"
3636
);

tests/Makefile

+5
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
1+
ifneq ($(KERNELRELEASE),)
12
obj-m := testmodule.o
23
testmodule-objs := $(TEST_LIBRARY)
34
EXTRA_LDFLAGS += --entry=init_module
45

6+
$(M)/$(TEST_LIBRARY): $(TEST_LIBRARY_ARCHIVE)
7+
$(LD) -r -o $@ --whole-archive $^
8+
else
59
all:
610
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR)
711

812
clean:
913
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean
14+
endif

tests/run_tests.py

+3
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ def main():
4646
path
4747
)
4848
)
49+
library_archive, _ = os.path.splitext(os.path.basename(module))
50+
library_archive = os.path.join(library_archive, ".a")
4951
run(
5052
"make", "-C", BASE_DIR,
5153
"TEST_LIBRARY={}".format(
@@ -54,6 +56,7 @@ def main():
5456
os.path.basename(module)
5557
)
5658
),
59+
"TEST_LIBRARY_ARCHIVE={}".format(library_archive),
5760
)
5861
run(
5962
"rustc",

0 commit comments

Comments
 (0)