174901992Smrg#!/bin/sh 274901992Smrg 374901992Smrg# Test case for bug https://gitlab.freedesktop.org/xorg/util/makedepend/issues/1 474901992Smrg 574901992Smrgset -e 674901992Smrg 774901992Smrgif [ "x$test_srcdir" = "x" ]; then 874901992Smrg test_srcdir=.. 974901992Smrgfi 1074901992Smrg 1174901992Smrgif [ "x$test_builddir" = "x" ]; then 1274901992Smrg test_builddir=.. 1374901992Smrgfi 1474901992Smrg 1574901992Smrgif [ "x$MAKEDEPEND" = "x" ]; then 1674901992Smrg MAKEDEPEND=makedepend 1774901992Smrgfi 1874901992Smrg 1974901992Smrgmkdir -p ${test_builddir}/1 2074901992Smrgcd ${test_builddir}/1 2174901992Smrg 2274901992Smrgpwd 2374901992Smrg 2474901992Smrg# Create test conditions: 2574901992Smrg# - directory named "one" containing file one.cpp which includes def.h in the same directory 2674901992Smrg# - directory named "two" containing file two.cpp which includes def.h in the same directory 2774901992Smrgmkdir -p one two 2874901992Smrg 2974901992Smrg# 2 headers with the same name but in different directories 3074901992Smrgtouch one/def.h two/def.h 3174901992Smrgcp ${test_srcdir}/1/one.cpp one/ 3274901992Smrgcp ${test_srcdir}/1/two.cpp two/ 3374901992Smrg 3474901992Smrg# two/two.cpp depends on two/def.h (not the one seen during exploration in previous directory) 3574901992Smrg$MAKEDEPEND -f- -I. one/one.cpp two/two.cpp | grep "two/two.o: one/def.h" && false 3674901992Smrg 3774901992Smrg 3874901992Smrg# Clean up 3974901992Smrgrm -rf one two 40