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

Commit

Permalink
Attempt to fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
TheDan64 committed Mar 27, 2019
1 parent cc1080b commit 39e5956
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion hello-world/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ kernel_module!(
HelloWorldModule,
author: "Alex Gaynor and Geoffrey Thomas",
description: "An extremely simple kernel module",
license: "GPL"
__module_license_string: "GPL"
);
5 changes: 5 additions & 0 deletions tests/Makefile
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
ifneq ($(KERNELRELEASE),)
obj-m := testmodule.o
testmodule-objs := $(TEST_LIBRARY)
EXTRA_LDFLAGS += --entry=init_module

$(M)/$(TEST_LIBRARY): $(TEST_LIBRARY_ARCHIVE)
$(LD) -r -o $@ --whole-archive $^
else
all:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR)

clean:
$(MAKE) -C /lib/modules/$(shell uname -r)/build M=$(CURDIR) clean
endif
3 changes: 3 additions & 0 deletions tests/run_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def main():
path
)
)
library_archive, _ = os.path.splitext(os.path.basename(module))
library_archive = os.path.join(library_archive, ".a")
run(
"make", "-C", BASE_DIR,
"TEST_LIBRARY={}".format(
Expand All @@ -54,6 +56,7 @@ def main():
os.path.basename(module)
)
),
"TEST_LIBRARY_ARCHIVE={}".format(library_archive),
)
run(
"rustc",
Expand Down

0 comments on commit 39e5956

Please sign in to comment.