From c12dd9228c852ba95c20df834fe6013a71c0acaf Mon Sep 17 00:00:00 2001 From: Joel Rosdahl Date: Thu, 4 Jan 2018 21:09:10 +0100 Subject: test: Check more cases of path normalization --- test.sh | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/test.sh b/test.sh index 53f68b82..042fc0a0 100755 --- a/test.sh +++ b/test.sh @@ -3,7 +3,7 @@ # A simple test suite for ccache. # # Copyright (C) 2002-2007 Andrew Tridgell -# Copyright (C) 2009-2017 Joel Rosdahl +# Copyright (C) 2009-2018 Joel Rosdahl # # 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 the Free Software @@ -2354,9 +2354,13 @@ SUITE_basedir() { expect_stat 'cache hit (preprocessed)' 0 expect_stat 'cache miss' 1 + mkdir subdir + ln -s `pwd`/include subdir/symlink + # Rewriting triggered by CCACHE_BASEDIR should handle paths with multiple - # slashes correctly: - CCACHE_BASEDIR=`pwd` $CCACHE_COMPILE -I`pwd`//include -c `pwd`//src/test.c + # slashes, redundant "/." parts and "foo/.." parts correctly. Note that the + # ".." part of the path is resolved after the symlink has been resolved. + CCACHE_BASEDIR=`pwd` $CCACHE_COMPILE -I`pwd`//./subdir/symlink/../include -c `pwd`/src/test.c expect_stat 'cache hit (direct)' 1 expect_stat 'cache hit (preprocessed)' 0 expect_stat 'cache miss' 1 -- cgit v1.2.1