From: Joel Rosdahl Date: Mon, 17 Feb 2020 19:46:05 +0000 (+0100) Subject: Move basedir tests to the basedir test suite X-Git-Tag: v4.0~600 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d72a87bdeb420823b28646efc5408c13f2a84b8d;p=thirdparty%2Fccache.git Move basedir tests to the basedir test suite --- diff --git a/test/suites/base.bash b/test/suites/base.bash index 6e0c1a928..e625b34df 100644 --- a/test/suites/base.bash +++ b/test/suites/base.bash @@ -1076,52 +1076,6 @@ EOF expect_stat 'cache hit (preprocessed)' 1 expect_stat 'cache miss' 1 - # ------------------------------------------------------------------------- -if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then - TEST "Symlink to source directory" - - mkdir dir - cd dir - mkdir -p d1/d2 - echo '#define A "OK"' >d1/h.h - cat <d1/d2/c.c -#include -#include "../h.h" -int main() { printf("%s\n", A); } -EOF - echo '#define A "BUG"' >h.h - ln -s d1/d2 d3 - - CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/d3/c.c - $REAL_COMPILER c.o -o c - if [ "$(./c)" != OK ]; then - test_failed "Incorrect header file used" - fi - -fi - # ------------------------------------------------------------------------- -if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then - TEST "Symlink to source file" - - mkdir dir - cd dir - mkdir d - echo '#define A "BUG"' >d/h.h - cat <d/c.c -#include -#include "h.h" -int main() { printf("%s\n", A); } -EOF - echo '#define A "OK"' >h.h - ln -s d/c.c c.c - - CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/c.c - $REAL_COMPILER c.o -o c - if [ "$(./c)" != OK ]; then - test_failed "Incorrect header file used" - fi - -fi # ------------------------------------------------------------------------- if ! $HOST_OS_WINDOWS; then TEST ".incbin" diff --git a/test/suites/basedir.bash b/test/suites/basedir.bash index ba623a8fc..decfa893c 100644 --- a/test/suites/basedir.bash +++ b/test/suites/basedir.bash @@ -45,7 +45,7 @@ SUITE_basedir() { expect_stat 'cache miss' 2 # ------------------------------------------------------------------------- - if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then +if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then TEST "Path normalization" cd dir1 @@ -64,8 +64,54 @@ SUITE_basedir() { expect_stat 'cache hit (direct)' 1 expect_stat 'cache hit (preprocessed)' 0 expect_stat 'cache miss' 1 +fi + + # ------------------------------------------------------------------------- +if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then + TEST "Symlink to source directory" + + mkdir dir + cd dir + mkdir -p d1/d2 + echo '#define A "OK"' >d1/h.h + cat <d1/d2/c.c +#include +#include "../h.h" +int main() { printf("%s\n", A); } +EOF + echo '#define A "BUG"' >h.h + ln -s d1/d2 d3 + + CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/d3/c.c + $REAL_COMPILER c.o -o c + if [ "$(./c)" != OK ]; then + test_failed "Incorrect header file used" + fi +fi + + # ------------------------------------------------------------------------- +if ! $HOST_OS_WINDOWS && ! $HOST_OS_CYGWIN; then + TEST "Symlink to source file" + + mkdir dir + cd dir + mkdir d + echo '#define A "BUG"' >d/h.h + cat <d/c.c +#include +#include "h.h" +int main() { printf("%s\n", A); } +EOF + echo '#define A "OK"' >h.h + ln -s d/c.c c.c + + CCACHE_BASEDIR=/ $CCACHE_COMPILE -c $PWD/c.c + $REAL_COMPILER c.o -o c + if [ "$(./c)" != OK ]; then + test_failed "Incorrect header file used" + fi +fi - fi # ------------------------------------------------------------------------- TEST "Rewriting in stderr"