Code

test-lib: Work around incompatible sort and find on Windows
authorJohannes Sixt <j6t@kdbg.org>
Wed, 11 Mar 2009 20:17:26 +0000 (21:17 +0100)
committerJohannes Sixt <j6t@kdbg.org>
Thu, 19 Mar 2009 21:04:25 +0000 (22:04 +0100)
If the PATH lists the Windows system directories before the MSYS
directories, Windows's own incompatible sort and find commands would be
picked up. We implement these commands as functions and call the real
tools by absolute path.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
t/test-lib.sh

index 638cca41e3bb08da342a5ed115a0d1f779f63fbb..4eda5aba4b48eb871e684ccd9cd1b6e42439f025 100644 (file)
@@ -635,3 +635,16 @@ do
                test_done
        esac
 done
+
+# Fix some commands on Windows
+case $(uname -s) in
+*MINGW*)
+       # Windows has its own (incompatible) sort and find
+       sort () {
+               /usr/bin/sort "$@"
+       }
+       find () {
+               /usr/bin/find "$@"
+       }
+       ;;
+esac