From 29a58d7d51ac1fa1e95b1993ab0f670f01e9af78 Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Sun, 4 Apr 2021 23:35:35 +0200 Subject: [PATCH] Next attempt at integration test fix --- 12_integrated_testing/README.md | 4 ++-- .../tests/00_console_sanity.rs | 4 ++-- 13_exceptions_part2_peripheral_IRQs/README.md | 18 ------------------ .../tests/00_console_sanity.rs | 9 ++++++++- .../tests/00_console_sanity.rs | 9 ++++++++- .../tests/00_console_sanity.rs | 9 ++++++++- .../tests/00_console_sanity.rs | 9 ++++++++- 7 files changed, 36 insertions(+), 26 deletions(-) diff --git a/12_integrated_testing/README.md b/12_integrated_testing/README.md index 113e09d2..192728cf 100644 --- a/12_integrated_testing/README.md +++ b/12_integrated_testing/README.md @@ -1853,8 +1853,8 @@ diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rs 12_integrate + // 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 ++ // For some reason, in this test, 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)); diff --git a/12_integrated_testing/tests/00_console_sanity.rs b/12_integrated_testing/tests/00_console_sanity.rs index 40dc4b41..84b74479 100644 --- a/12_integrated_testing/tests/00_console_sanity.rs +++ b/12_integrated_testing/tests/00_console_sanity.rs @@ -33,8 +33,8 @@ unsafe fn kernel_init() -> ! { // 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 + // For some reason, in this test, 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)); diff --git a/13_exceptions_part2_peripheral_IRQs/README.md b/13_exceptions_part2_peripheral_IRQs/README.md index b970cc25..0c7188b9 100644 --- a/13_exceptions_part2_peripheral_IRQs/README.md +++ b/13_exceptions_part2_peripheral_IRQs/README.md @@ -2716,24 +2716,6 @@ 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/13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rs b/13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rs index ad7fd2bf..84b74479 100644 --- a/13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rs +++ b/13_exceptions_part2_peripheral_IRQs/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, 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/14_virtual_mem_part2_mmio_remap/tests/00_console_sanity.rs b/14_virtual_mem_part2_mmio_remap/tests/00_console_sanity.rs index ad7fd2bf..84b74479 100644 --- a/14_virtual_mem_part2_mmio_remap/tests/00_console_sanity.rs +++ b/14_virtual_mem_part2_mmio_remap/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, 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/15_virtual_mem_part3_precomputed_tables/tests/00_console_sanity.rs b/15_virtual_mem_part3_precomputed_tables/tests/00_console_sanity.rs index ad7fd2bf..84b74479 100644 --- a/15_virtual_mem_part3_precomputed_tables/tests/00_console_sanity.rs +++ b/15_virtual_mem_part3_precomputed_tables/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, 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/16_virtual_mem_part4_higher_half_kernel/tests/00_console_sanity.rs b/16_virtual_mem_part4_higher_half_kernel/tests/00_console_sanity.rs index ad7fd2bf..84b74479 100644 --- a/16_virtual_mem_part4_higher_half_kernel/tests/00_console_sanity.rs +++ b/16_virtual_mem_part4_higher_half_kernel/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, 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() }