From 8c3f1869cd0063c6c5e88b56db6eef1e7da8e134 Mon Sep 17 00:00:00 2001 From: Sung-Jae Lee Date: Tue, 3 May 2016 14:16:52 +0900 Subject: Fix 'runtest.sh' script This change fixes a bug in the 'runtest.sh' that read test cases from file given by '--testDirFile=' option. Remove LF characters while reading each line to make array properly. Also changes similar codes in other place to same simple one. --- tests/runtest.sh | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'tests/runtest.sh') diff --git a/tests/runtest.sh b/tests/runtest.sh index 7bbe6528e2..d6105c243a 100755 --- a/tests/runtest.sh +++ b/tests/runtest.sh @@ -429,25 +429,17 @@ declare -a playlistTests function load_unsupported_tests { # Load the list of tests that are not supported on this platform. These tests are disabled (skipped) permanently. - # 'readarray' is not used here, as it includes the trailing linefeed in lines placed in the array. - while IFS='' read -r line || [ -n "$line" ]; do - unsupportedTests[${#unsupportedTests[@]}]=$line - done <"$(dirname "$0")/testsUnsupportedOutsideWindows.txt" + readarray -t unsupportedTests <"$(dirname "$0")/testsUnsupportedOutsideWindows.txt" } function load_failing_tests { # Load the list of tests that fail on this platform. These tests are disabled (skipped) temporarily, pending investigation. - # 'readarray' is not used here, as it includes the trailing linefeed in lines placed in the array. - while IFS='' read -r line || [ -n "$line" ]; do - failingTests[${#failingTests[@]}]=$line - done <"$(dirname "$0")/testsFailingOutsideWindows.txt" + readarray -t failingTests <"$(dirname "$0")/testsFailingOutsideWindows.txt" } function load_playlist_tests { # Load the list of tests that are enabled as a part of this test playlist. - while IFS='' read -r line || [ -n "$line" ]; do - playlistTests[${#playlistTests[@]}]=$line - done <"${playlistFile}" + readarray -t playlistTests <"${playlistFile}" } function is_unsupported_test { @@ -647,7 +639,7 @@ function set_test_directories { exit_with_error "$errorSource" "Test directories file not found at $listFileName" fi - readarray testDirectories < "$listFileName" + readarray -t testDirectories < "$listFileName" } function run_tests_in_directory { -- cgit v1.2.3