Skip to content

Commit 86c041a

Browse files
committed
Fix integration test fail
1 parent b418651 commit 86c041a

File tree

5 files changed

+40
-23
lines changed

5 files changed

+40
-23
lines changed

12_integrated_testing/Cargo.toml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,8 @@ version = "0.12.0"
44
authors = ["Andre Richter <andre.o.richter@gmail.com>"]
55
edition = "2018"
66

7-
# TODO: FIXME
8-
# LTO seems to kill the console integration test (empty text section). Disable until a fix is found.
97
[profile.release]
10-
lto = false
8+
lto = true
119

1210
[features]
1311
default = []

12_integrated_testing/README.md

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -818,21 +818,15 @@ diff -uNr 11_exceptions_part1_groundwork/.cargo/config.toml 12_integrated_testin
818818
diff -uNr 11_exceptions_part1_groundwork/Cargo.toml 12_integrated_testing/Cargo.toml
819819
--- 11_exceptions_part1_groundwork/Cargo.toml
820820
+++ 12_integrated_testing/Cargo.toml
821-
@@ -1,30 +1,58 @@
821+
@@ -1,6 +1,6 @@
822822
[package]
823823
name = "mingo"
824824
-version = "0.11.0"
825825
+version = "0.12.0"
826826
authors = ["Andre Richter <andre.o.richter@gmail.com>"]
827827
edition = "2018"
828828

829-
+# TODO: FIXME
830-
+# LTO seems to kill the console integration test (empty text section). Disable until a fix is found.
831-
[profile.release]
832-
-lto = true
833-
+lto = false
834-
835-
[features]
829+
@@ -11,20 +11,46 @@
836830
default = []
837831
bsp_rpi3 = ["register"]
838832
bsp_rpi4 = ["register"]
@@ -1823,7 +1817,7 @@ diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rb 12_integrate
18231817
diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rs 12_integrated_testing/tests/00_console_sanity.rs
18241818
--- 11_exceptions_part1_groundwork/tests/00_console_sanity.rs
18251819
+++ 12_integrated_testing/tests/00_console_sanity.rs
1826-
@@ -0,0 +1,35 @@
1820+
@@ -0,0 +1,42 @@
18271821
+// SPDX-License-Identifier: MIT OR Apache-2.0
18281822
+//
18291823
+// Copyright (c) 2019-2021 Andre Richter <andre.o.richter@gmail.com>
@@ -1857,7 +1851,14 @@ diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rs 12_integrate
18571851
+ print!("{}", console().chars_read());
18581852
+
18591853
+ // The QEMU process running this test will be closed by the I/O test harness.
1860-
+ cpu::wait_forever()
1854+
+ // cpu::wait_forever();
1855+
+
1856+
+ // For some reason, in this test in this tutorial, rustc or the linker produces an empty binary
1857+
+ // when wait_forever() is used. Calling qemu_exit_success() fixes this behavior. So for the time
1858+
+ // being, the following lines are just a workaround to fix this compiler/linker weirdness.
1859+
+ use libkernel::time::interface::TimeManager;
1860+
+ libkernel::time::time_manager().spin_for(core::time::Duration::from_secs(3600));
1861+
+ cpu::qemu_exit_success()
18611862
+}
18621863

18631864
diff -uNr 11_exceptions_part1_groundwork/tests/01_timer_sanity.rs 12_integrated_testing/tests/01_timer_sanity.rs

12_integrated_testing/tests/00_console_sanity.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,5 +31,12 @@ unsafe fn kernel_init() -> ! {
3131
print!("{}", console().chars_read());
3232

3333
// The QEMU process running this test will be closed by the I/O test harness.
34-
cpu::wait_forever()
34+
// cpu::wait_forever();
35+
36+
// For some reason, in this test in this tutorial, rustc or the linker produces an empty binary
37+
// when wait_forever() is used. Calling qemu_exit_success() fixes this behavior. So for the time
38+
// being, the following lines are just a workaround to fix this compiler/linker weirdness.
39+
use libkernel::time::interface::TimeManager;
40+
libkernel::time::time_manager().spin_for(core::time::Duration::from_secs(3600));
41+
cpu::qemu_exit_success()
3542
}

13_exceptions_part2_peripheral_IRQs/README.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -749,22 +749,14 @@ Minipush 1.0
749749
diff -uNr 12_integrated_testing/Cargo.toml 13_exceptions_part2_peripheral_IRQs/Cargo.toml
750750
--- 12_integrated_testing/Cargo.toml
751751
+++ 13_exceptions_part2_peripheral_IRQs/Cargo.toml
752-
@@ -1,13 +1,11 @@
752+
@@ -1,6 +1,6 @@
753753
[package]
754754
name = "mingo"
755755
-version = "0.12.0"
756756
+version = "0.13.0"
757757
authors = ["Andre Richter <andre.o.richter@gmail.com>"]
758758
edition = "2018"
759759

760-
-# TODO: FIXME
761-
-# LTO seems to kill the console integration test (empty text section). Disable until a fix is found.
762-
[profile.release]
763-
-lto = false
764-
+lto = true
765-
766-
[features]
767-
default = []
768760

769761
diff -uNr 12_integrated_testing/src/_arch/aarch64/cpu/smp.rs 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/smp.rs
770762
--- 12_integrated_testing/src/_arch/aarch64/cpu/smp.rs
@@ -2724,6 +2716,24 @@ diff -uNr 12_integrated_testing/src/synchronization.rs 13_exceptions_part2_perip
27242716
+ }
27252717
}
27262718

2719+
diff -uNr 12_integrated_testing/tests/00_console_sanity.rs 13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rs
2720+
--- 12_integrated_testing/tests/00_console_sanity.rs
2721+
+++ 13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rs
2722+
@@ -31,12 +31,5 @@
2723+
print!("{}", console().chars_read());
2724+
2725+
// The QEMU process running this test will be closed by the I/O test harness.
2726+
- // cpu::wait_forever();
2727+
-
2728+
- // For some reason, in this test in this tutorial, rustc or the linker produces an empty binary
2729+
- // when wait_forever() is used. Calling qemu_exit_success() fixes this behavior. So for the time
2730+
- // being, the following lines are just a workaround to fix this compiler/linker weirdness.
2731+
- use libkernel::time::interface::TimeManager;
2732+
- libkernel::time::time_manager().spin_for(core::time::Duration::from_secs(3600));
2733+
- cpu::qemu_exit_success()
2734+
+ cpu::wait_forever()
2735+
}
2736+
27272737
diff -uNr 12_integrated_testing/tests/03_exception_irq_sanity.rs 13_exceptions_part2_peripheral_IRQs/tests/03_exception_irq_sanity.rs
27282738
--- 12_integrated_testing/tests/03_exception_irq_sanity.rs
27292739
+++ 13_exceptions_part2_peripheral_IRQs/tests/03_exception_irq_sanity.rs

utils/devtool.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ def ready_for_publish
190190

191191
def ready_for_publish_no_rust
192192
clean
193+
fmt
193194
misspell
194195
rubocop
195196
copyright

0 commit comments

Comments
 (0)