From 5d746828ad1311d88d0a6013aeb1b009d4d1f74a Mon Sep 17 00:00:00 2001 From: Andre Richter Date: Tue, 19 Apr 2022 09:10:36 +0200 Subject: [PATCH] Remove relative path import from test scripts --- 12_integrated_testing/README.md | 4 ++-- 12_integrated_testing/tests/00_console_sanity.rb | 2 +- .../tests/03_exception_restore_sanity.rb | 2 +- .../tests/00_console_sanity.rb | 2 +- .../tests/03_exception_restore_sanity.rb | 2 +- .../tests/00_console_sanity.rb | 2 +- .../tests/03_exception_restore_sanity.rb | 2 +- .../tests/00_console_sanity.rb | 2 +- .../tests/03_exception_restore_sanity.rb | 2 +- .../tests/00_console_sanity.rb | 2 +- .../tests/03_exception_restore_sanity.rb | 2 +- common/tests/dispatch.rb | 9 ++++++--- 12 files changed, 18 insertions(+), 15 deletions(-) diff --git a/12_integrated_testing/README.md b/12_integrated_testing/README.md index 3bd88c96..bfcff97a 100644 --- a/12_integrated_testing/README.md +++ b/12_integrated_testing/README.md @@ -1824,7 +1824,7 @@ diff -uNr 11_exceptions_part1_groundwork/tests/00_console_sanity.rb 12_integrate +# +# Copyright (c) 2019-2022 Andre Richter + -+require_relative '../../common/tests/console_io_test' ++require 'console_io_test' + +# Verify sending and receiving works as expected. +class TxRxHandshakeTest < SubtestBase @@ -2022,7 +2022,7 @@ diff -uNr 11_exceptions_part1_groundwork/tests/03_exception_restore_sanity.rb 12 +# +# Copyright (c) 2022 Andre Richter + -+require_relative '../../common/tests/console_io_test' ++require 'console_io_test' + +# Verify that exception restore works. +class ExceptionRestoreTest < SubtestBase diff --git a/12_integrated_testing/tests/00_console_sanity.rb b/12_integrated_testing/tests/00_console_sanity.rb index 48c9703d..4dde5576 100644 --- a/12_integrated_testing/tests/00_console_sanity.rb +++ b/12_integrated_testing/tests/00_console_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2019-2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify sending and receiving works as expected. class TxRxHandshakeTest < SubtestBase diff --git a/12_integrated_testing/tests/03_exception_restore_sanity.rb b/12_integrated_testing/tests/03_exception_restore_sanity.rb index c3c725ed..5f52e0c7 100644 --- a/12_integrated_testing/tests/03_exception_restore_sanity.rb +++ b/12_integrated_testing/tests/03_exception_restore_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify that exception restore works. class ExceptionRestoreTest < SubtestBase diff --git a/13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rb b/13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rb index 48c9703d..4dde5576 100644 --- a/13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rb +++ b/13_exceptions_part2_peripheral_IRQs/tests/00_console_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2019-2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify sending and receiving works as expected. class TxRxHandshakeTest < SubtestBase diff --git a/13_exceptions_part2_peripheral_IRQs/tests/03_exception_restore_sanity.rb b/13_exceptions_part2_peripheral_IRQs/tests/03_exception_restore_sanity.rb index c3c725ed..5f52e0c7 100644 --- a/13_exceptions_part2_peripheral_IRQs/tests/03_exception_restore_sanity.rb +++ b/13_exceptions_part2_peripheral_IRQs/tests/03_exception_restore_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify that exception restore works. class ExceptionRestoreTest < SubtestBase diff --git a/14_virtual_mem_part2_mmio_remap/tests/00_console_sanity.rb b/14_virtual_mem_part2_mmio_remap/tests/00_console_sanity.rb index 48c9703d..4dde5576 100644 --- a/14_virtual_mem_part2_mmio_remap/tests/00_console_sanity.rb +++ b/14_virtual_mem_part2_mmio_remap/tests/00_console_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2019-2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify sending and receiving works as expected. class TxRxHandshakeTest < SubtestBase diff --git a/14_virtual_mem_part2_mmio_remap/tests/03_exception_restore_sanity.rb b/14_virtual_mem_part2_mmio_remap/tests/03_exception_restore_sanity.rb index c3c725ed..5f52e0c7 100644 --- a/14_virtual_mem_part2_mmio_remap/tests/03_exception_restore_sanity.rb +++ b/14_virtual_mem_part2_mmio_remap/tests/03_exception_restore_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify that exception restore works. class ExceptionRestoreTest < SubtestBase diff --git a/15_virtual_mem_part3_precomputed_tables/tests/00_console_sanity.rb b/15_virtual_mem_part3_precomputed_tables/tests/00_console_sanity.rb index 48c9703d..4dde5576 100644 --- a/15_virtual_mem_part3_precomputed_tables/tests/00_console_sanity.rb +++ b/15_virtual_mem_part3_precomputed_tables/tests/00_console_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2019-2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify sending and receiving works as expected. class TxRxHandshakeTest < SubtestBase diff --git a/15_virtual_mem_part3_precomputed_tables/tests/03_exception_restore_sanity.rb b/15_virtual_mem_part3_precomputed_tables/tests/03_exception_restore_sanity.rb index c3c725ed..5f52e0c7 100644 --- a/15_virtual_mem_part3_precomputed_tables/tests/03_exception_restore_sanity.rb +++ b/15_virtual_mem_part3_precomputed_tables/tests/03_exception_restore_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify that exception restore works. class ExceptionRestoreTest < SubtestBase diff --git a/16_virtual_mem_part4_higher_half_kernel/tests/00_console_sanity.rb b/16_virtual_mem_part4_higher_half_kernel/tests/00_console_sanity.rb index 48c9703d..4dde5576 100644 --- a/16_virtual_mem_part4_higher_half_kernel/tests/00_console_sanity.rb +++ b/16_virtual_mem_part4_higher_half_kernel/tests/00_console_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2019-2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify sending and receiving works as expected. class TxRxHandshakeTest < SubtestBase diff --git a/16_virtual_mem_part4_higher_half_kernel/tests/03_exception_restore_sanity.rb b/16_virtual_mem_part4_higher_half_kernel/tests/03_exception_restore_sanity.rb index c3c725ed..5f52e0c7 100644 --- a/16_virtual_mem_part4_higher_half_kernel/tests/03_exception_restore_sanity.rb +++ b/16_virtual_mem_part4_higher_half_kernel/tests/03_exception_restore_sanity.rb @@ -4,7 +4,7 @@ # # Copyright (c) 2022 Andre Richter -require_relative '../../common/tests/console_io_test' +require 'console_io_test' # Verify that exception restore works. class ExceptionRestoreTest < SubtestBase diff --git a/common/tests/dispatch.rb b/common/tests/dispatch.rb index 13ae3af8..86aaea86 100755 --- a/common/tests/dispatch.rb +++ b/common/tests/dispatch.rb @@ -5,9 +5,12 @@ # # Copyright (c) 2019-2022 Andre Richter -require_relative 'boot_test' -require_relative 'console_io_test' -require_relative 'exit_code_test' +file_dir = File.dirname(__FILE__) +$LOAD_PATH.unshift(file_dir) unless $LOAD_PATH.include?(file_dir) + +require 'boot_test' +require 'console_io_test' +require 'exit_code_test' qemu_cmd = ARGV.join(' ') binary = ARGV.last