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

Commit ede0645

Browse files
committed
Don't build the kernel module when building test modules
1 parent 998c374 commit ede0645

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

tests/chrdev-region-allocation/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ edition = "2018"
88
crate-type = ["staticlib"]
99
test = false
1010

11+
[features]
12+
default = ["linux-kernel-module"]
13+
1114
[dependencies]
12-
linux-kernel-module = { path = "../.." }
15+
linux-kernel-module = { path = "../..", optional = true }
1316

1417
[dev-dependencies]
1518
kernel-module-testlib = { path = "../../testlib" }

tests/chrdev/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ edition = "2018"
88
crate-type = ["staticlib"]
99
test = false
1010

11+
[features]
12+
default = ["linux-kernel-module"]
13+
1114
[dependencies]
12-
linux-kernel-module = { path = "../.." }
15+
linux-kernel-module = { path = "../..", optional = true }
1316

1417
[dev-dependencies]
1518
kernel-module-testlib = { path = "../../testlib" }

tests/printk/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ edition = "2018"
88
crate-type = ["staticlib"]
99
test = false
1010

11+
[features]
12+
default = ["linux-kernel-module"]
13+
1114
[dependencies]
12-
linux-kernel-module = { path = "../.." }
15+
linux-kernel-module = { path = "../..", optional = true }
1316

1417
[dev-dependencies]
1518
kernel-module-testlib = { path = "../../testlib" }

tests/run_tests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ def main():
4646
)
4747
# TODO: qemu
4848
run(
49-
"cargo", "test", "--", "--test-threads=1",
49+
"cargo", "test", "--no-default-features", "--", "--test-threads=1",
5050
cwd=os.path.join(BASE_DIR, path),
5151
environ=dict(
5252
os.environ,

tests/sysctl-get/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ edition = "2018"
88
crate-type = ["staticlib"]
99
test = false
1010

11+
[features]
12+
default = ["linux-kernel-module"]
13+
1114
[dependencies]
12-
linux-kernel-module = { path = "../.." }
15+
linux-kernel-module = { path = "../..", optional = true }
1316

1417
[dev-dependencies]
1518
kernel-module-testlib = { path = "../../testlib" }

tests/sysctl/Cargo.toml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,11 @@ edition = "2018"
88
crate-type = ["staticlib"]
99
test = false
1010

11+
[features]
12+
default = ["linux-kernel-module"]
13+
1114
[dependencies]
12-
linux-kernel-module = { path = "../.." }
15+
linux-kernel-module = { path = "../..", optional = true }
1316

1417
[dev-dependencies]
1518
kernel-module-testlib = { path = "../../testlib" }

0 commit comments

Comments
 (0)