Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 37582ac

Browse files
authored
Merge pull request #486 from rust-osdev/separate-workspace-for-test-kernels
Move test kernels to a separate workspace
2 parents 8165441 + 72637a6 commit 37582ac

File tree

7 files changed

+189
-39
lines changed

7 files changed

+189
-39
lines changed

‎.github/workflows/ci.yml‎

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@ jobs:
2525
- uses: r7kamura/rust-problem-matchers@v1.1.0
2626
- name: "Run `cargo check`"
2727
run: cargo check --all-targets --all
28+
- name: "Check test kernels"
29+
run: cargo check --all
30+
working-directory: tests/test_kernels
2831
- name: "Check docs.rs build"
2932
run: cargo check
3033
env:
@@ -89,6 +92,8 @@ jobs:
8992
- uses: actions/checkout@v3
9093
- uses: r7kamura/rust-problem-matchers@v1.1.0
9194
- run: cargo fmt --all -- --check
95+
- run: cargo fmt --all -- --check
96+
working-directory: tests/test_kernels
9297

9398
clippy:
9499
name: Clippy
@@ -99,6 +104,8 @@ jobs:
99104
- uses: Swatinem/rust-cache@v2
100105
- uses: r7kamura/rust-problem-matchers@v1.1.0
101106
- run: cargo clippy --all --all-targets
107+
- run: cargo clippy --all
108+
working-directory: tests/test_kernels
102109

103110
semver-checks:
104111
name: Semver Checks

‎Cargo.lock‎

Lines changed: 0 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎Cargo.toml‎

Lines changed: 1 addition & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
cargo-features = ["profile-rustflags"]
2-
31
[package]
42
name = "bootloader"
53
description = "An experimental x86_64 bootloader that works on both BIOS and UEFI systems."
@@ -19,17 +17,8 @@ members = [
1917
"bios/stage-*",
2018
"bios/common",
2119
"tests/runner",
22-
"tests/test_kernels/default_settings",
23-
"tests/test_kernels/map_phys_mem",
24-
"tests/test_kernels/higher_half",
25-
"tests/test_kernels/pie",
26-
"tests/test_kernels/lto",
27-
"tests/test_kernels/ramdisk",
28-
"tests/test_kernels/min_stack",
29-
"tests/test_kernels/lower_memory_free",
30-
"tests/test_kernels/write_usable_memory",
3120
]
32-
exclude = ["examples/basic", "examples/test_framework"]
21+
exclude = ["examples/basic", "examples/test_framework", "tests/test_kernels/*"]
3322

3423
[workspace.package]
3524
# don't forget to update `workspace.dependencies` below
@@ -110,23 +99,6 @@ inherits = "release"
11099
debug = true
111100
overflow-checks = true
112101

113-
[profile.lto]
114-
inherits = "release"
115-
lto = true
116-
117-
[profile.test.package.test_kernel_higher_half]
118-
rustflags = [
119-
"-C",
120-
"link-args=--image-base 0xFFFF800000000000",
121-
"-C",
122-
"relocation-model=pic",
123-
"-C",
124-
"code-model=large",
125-
]
126-
127-
[profile.test.package.test_kernel_min_stack]
128-
opt-level = 2
129-
130102
[build-dependencies]
131103
llvm-tools = "0.1.1"
132104

‎tests/lto.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ use bootloader_test_runner::run_test_kernel;
66
fn basic_boot() {
77
// build test kernel manually to force-enable link-time optimization
88
let mut cmd = Command::new(std::env::var("CARGO").unwrap_or_else(|_| "cargo".into()));
9+
cmd.current_dir("tests/test_kernels");
910
cmd.arg("build");
1011
cmd.arg("-p").arg("test_kernel_lto");
11-
cmd.arg("--target").arg("x86_64-unknown-none");
1212
cmd.arg("--profile").arg("lto");
1313
let status = cmd.status().unwrap();
1414
assert!(status.success());
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
[build]
22
target-dir = "../../target"
3+
target = "x86_64-unknown-none"

‎tests/test_kernels/Cargo.lock‎

Lines changed: 141 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎tests/test_kernels/Cargo.toml‎

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
cargo-features = ["profile-rustflags"]
2+
3+
[workspace]
4+
resolver = "2"
5+
members = [
6+
"default_settings",
7+
"map_phys_mem",
8+
"higher_half",
9+
"pie",
10+
"lto",
11+
"ramdisk",
12+
"min_stack",
13+
"lower_memory_free",
14+
"write_usable_memory",
15+
]
16+
17+
[profile.release]
18+
panic = "abort"
19+
lto = false
20+
debug = true
21+
overflow-checks = true
22+
23+
[profile.lto]
24+
inherits = "release"
25+
lto = true
26+
27+
[profile.test.package.test_kernel_higher_half]
28+
rustflags = [
29+
"-C",
30+
"link-args=--image-base 0xFFFF800000000000",
31+
"-C",
32+
"relocation-model=pic",
33+
"-C",
34+
"code-model=large",
35+
]
36+
37+
[profile.test.package.test_kernel_min_stack]
38+
opt-level = 2

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /