From 86c041a41f7be447aee3e540ebe2c6eeaafd4a09 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sun, 4 Apr 2021 23:24:44 +0200 Subject: [PATCH] Fix integration test fail --- 12_integrated_testing/Cargo.toml | 4 +-- 12_integrated_testing/README.md | 21 +++++++------- .../tests/00_console_sanity.rs | 9 +++++- 13_exceptions_part2_peripheral_IRQs/README.md | 28 +++++++++++++------ utils/devtool.rb | 1 + 5 files changed, 40 insertions(+), 23 deletions(-) diff --git a/12_integrated_testing/Cargo.toml b/12_integrated_testing/Cargo.toml index d59d5817..686df764 100644 --- a/12_integrated_testing/Cargo.toml +++ b/12_integrated_testing/Cargo.toml @@ -4,10 +4,8 @@ version = "0.12.0" authors = ["Andre Richter "] edition = "2018" -# TODO: FIXME -# LTO seems to kill the console integration test (empty text section). Disable until a fix is found. [profile.release] -lto = false +lto = true [features] default = [] diff --git a/12_integrated_testing/README.md b/12_integrated_testing/README.md index c49f8361..113e09d2 100644 --- a/12_integrated_testing/README.md +++ b/12_integrated_testing/README.md @@ -818,7 +818,7 @@ diff -uNr 11_exceptions_part1_groundwork/.cargo/config.toml 12_integrated_testin diff -uNr 11_exceptions_part1_groundwork/Cargo.toml 12_integrated_testing/Cargo.toml --- 11_exceptions_part1_groundwork/Cargo.toml +++ 12_integrated_testing/Cargo.toml -@@ -1,30 +1,58 @@ +@@ -1,6 +1,6 @@ [package] name = "mingo" -version = "0.11.0" @@ -826,13 +826,7 @@ diff -uNr 11_exceptions_part1_groundwork/Cargo.toml 12_integrated_testing/Cargo. authors = ["Andre Richter "] edition = "2018" -+# TODO: FIXME -+# LTO seems to kill the console integration test (empty text section). Disable until a fix is found. - [profile.release] --lto = true -+lto = false - - [features] +@@ -11,20 +11,46 @@ default = [] bsp_rpi3 = ["register"] bsp_rpi4 = ["register"] @@ -1823,7 +1817,7 @@ diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rb 12_integrate diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rs 12_integrated_testing/tests/00_console_sanity.rs --- 11_exceptions_part1_groundwork/tests/00_console_sanity.rs +++ 12_integrated_testing/tests/00_console_sanity.rs -@@ -0,0 +1,35 @@ +@@ -0,0 +1,42 @@ +// SPDX-License-Identifier: MIT OR Apache-2.0 +// +// Copyright (c) 2019-2021 Andre Richter @@ -1857,7 +1851,14 @@ diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rs 12_integrate + print!("{}", console().chars_read()); + + // The QEMU process running this test will be closed by the I/O test harness. -+ cpu::wait_forever() ++ // cpu::wait_forever(); ++ ++ // For some reason, in this test in this tutorial, rustc or the linker produces an empty binary ++ // when wait_forever() is used. Calling qemu_exit_success() fixes this behavior. So for the time ++ // being, the following lines are just a workaround to fix this compiler/linker weirdness. ++ use libkernel::time::interface::TimeManager; ++ libkernel::time::time_manager().spin_for(core::time::Duration::from_secs(3600)); ++ cpu::qemu_exit_success() +} diff -uNr 11_exceptions_part1_groundwork/tests/01_timer_sanity.rs 12_integrated_testing/tests/01_timer_sanity.rs diff --git a/12_integrated_testing/tests/00_console_sanity.rs b/12_integrated_testing/tests/00_console_sanity.rs index ad7fd2bf..40dc4b41 100644 --- a/12_integrated_testing/tests/00_console_sanity.rs +++ b/12_integrated_testing/tests/00_console_sanity.rs @@ -31,5 +31,12 @@ unsafe fn kernel_init() -> ! { print!("{}", console().chars_read()); // The QEMU process running this test will be closed by the I/O test harness. - cpu::wait_forever() + // cpu::wait_forever(); + + // For some reason, in this test in this tutorial, rustc or the linker produces an empty binary + // when wait_forever() is used. Calling qemu_exit_success() fixes this behavior. So for the time + // being, the following lines are just a workaround to fix this compiler/linker weirdness. + use libkernel::time::interface::TimeManager; + libkernel::time::time_manager().spin_for(core::time::Duration::from_secs(3600)); + cpu::qemu_exit_success() } diff --git a/13_exceptions_part2_peripheral_IRQs/README.md b/13_exceptions_part2_peripheral_IRQs/README.md index 6da5a075..b970cc25 100644 --- a/13_exceptions_part2_peripheral_IRQs/README.md +++ b/13_exceptions_part2_peripheral_IRQs/README.md @@ -749,7 +749,7 @@ Minipush 1.0 diff -uNr 12_integrated_testing/Cargo.toml 13_exceptions_part2_peripheral_IRQs/Cargo.toml --- 12_integrated_testing/Cargo.toml +++ 13_exceptions_part2_peripheral_IRQs/Cargo.toml -@@ -1,13 +1,11 @@ +@@ -1,6 +1,6 @@ [package] name = "mingo" -version = "0.12.0" @@ -757,14 +757,6 @@ diff -uNr 12_integrated_testing/Cargo.toml 13_exceptions_part2_peripheral_IRQs/C authors = ["Andre Richter "] edition = "2018" --# TODO: FIXME --# LTO seems to kill the console integration test (empty text section). Disable until a fix is found. - [profile.release] --lto = false -+lto = true - - [features] - default = [] diff -uNr 12_integrated_testing/src/_arch/aarch64/cpu/smp.rs 13_exceptions_part2_peripheral_IRQs/src/_arch/aarch64/cpu/smp.rs --- 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 + } } +diff -uNr 12_integrated_testing/tests/00_console_sanity.rs 13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rs +--- 12_integrated_testing/tests/00_console_sanity.rs ++++ 13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rs +@@ -31,12 +31,5 @@ + print!("{}", console().chars_read()); + + // The QEMU process running this test will be closed by the I/O test harness. +- // cpu::wait_forever(); +- +- // For some reason, in this test in this tutorial, rustc or the linker produces an empty binary +- // when wait_forever() is used. Calling qemu_exit_success() fixes this behavior. So for the time +- // being, the following lines are just a workaround to fix this compiler/linker weirdness. +- use libkernel::time::interface::TimeManager; +- libkernel::time::time_manager().spin_for(core::time::Duration::from_secs(3600)); +- cpu::qemu_exit_success() ++ cpu::wait_forever() + } + diff -uNr 12_integrated_testing/tests/03_exception_irq_sanity.rs 13_exceptions_part2_peripheral_IRQs/tests/03_exception_irq_sanity.rs --- 12_integrated_testing/tests/03_exception_irq_sanity.rs +++ 13_exceptions_part2_peripheral_IRQs/tests/03_exception_irq_sanity.rs diff --git a/utils/devtool.rb b/utils/devtool.rb index a3d5e3d7..a62af380 100755 --- a/utils/devtool.rb +++ b/utils/devtool.rb @@ -190,6 +190,7 @@ class DevTool def ready_for_publish_no_rust clean + fmt misspell rubocop copyright