From: Peter Rosin Date: Thu, 5 Jan 2012 09:45:16 +0000 (+0100) Subject: tests: work around strangeness in MSYS X-Git-Tag: ng-0.5a~69 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=317e6ca3cea900d1f401c27814cf672303aa813a;p=thirdparty%2Fautomake.git tests: work around strangeness in MSYS MSYS mishandles carriage returns and behaves very strangely for directories with colon in them. It seems that colon-directories are somehow mixed up with drive letters. Fixes automake bug#7849. * tests/instspc.tap: Skip instead of erroring out when $test_string is empty for the carriageret case, as that is expected on MSYS. Also, for similar reasons, skip instead of erroring out when it is not possible to cd into the just created directory, and the directory name contains a colon. Update copyright years. --- diff --git a/tests/instspc.tap b/tests/instspc.tap index 9eb145fdc..914b36c8f 100755 --- a/tests/instspc.tap +++ b/tests/instspc.tap @@ -1,5 +1,5 @@ #! /bin/sh -# Copyright (C) 2010, 2011 Free Software Foundation, Inc. +# Copyright (C) 2010, 2011, 2012 Free Software Foundation, Inc. # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -235,9 +235,20 @@ create_input_data for test_name in $test_names_list; do eval "test_string=\${instspc__$test_name}" \ - && test x"$test_string" != x \ || fatal_ "invalid test name: '$test_name'" + if test x"$test_string" = x; then + if test x"$test_name" != xcarriageret; then + fatal_ "invalid test name: '$test_name'" + else + # MSYS version 1.0.17 still mishandles carriage returns; see + # automake bug#7849. + skip_ -r "carriage-return treated as null char" "$test_name in builddir" + skip_ -r "carriage-return treated as null char" "$test_name in destdir" + continue + fi + fi + # Skip the next checks if this system doesn't support the required # characters in file names. @@ -247,6 +258,21 @@ for test_name in $test_names_list; do continue } + case $test_string in + *:*) + # On MSYS 1.0.17, "mkdir ./a:" creates ./a, and "cd ./a:" takes you + # to a strange directory with pwd equal to "a". But only for + # interactive shells. Or something? In this script, "cd ./a:" fails + # on MSYS. Marvelous. + ( cd "./$test_string" ) || { + rmdir "./$test_string" || fatal_ "removing directory" + skip_ -r "cd failed" "$test_name in builddir" + skip_ -r "cd failed" "$test_name in destdir" + continue + } + ;; + esac + # Where are the "weird" characters going to be used, in $(builddir) # or in $(DESTDIR)? They are always going to be used in $(prefix) # though; should we maybe separate this into a dedicated check?