testsuite: samples/Makefile reports pkg-config unavailable. test/Makefile reports samples not built. functions.source augmented appropriately.

v0.27.3
Robin Mills 12 years ago
parent 69720794d9
commit 06534b62ef

@ -83,6 +83,9 @@ BINSRC = addmoddel.cpp \
# Initialisations
SHELL = /bin/sh
PKGCONFIG=pkg-config
BAR='****************************************'
.SUFFIXES:
.SUFFIXES: .c .cpp .o .so
@ -105,6 +108,7 @@ endif
samples: $(BINARY) $(OTHER)
$(BINOBJ): %.o: %.cpp
@if [ -z `which $(PKGCONFIG)` ]; then echo $(BAR) $'\\n***' utility $(PKGCONFIG) not available $'***\n'$(BAR) ; exit 42 ; fi
$(COMPILE.cc) -I../src -o $@ $<
@$(MAKEDEPEND)
@$(POSTDEPEND)

@ -91,6 +91,9 @@ test:
@list='$(TESTS)'; for p in $$list; do \
echo Running $$p ...; \
./$$p; \
rc=$$?; \
if [ $$rc -ne 0 ]; then echo result = $$rc ; fi ; \
if [ $$rc -gt 2 ]; then exit $$rc ; fi ; \
done
testv:

@ -340,6 +340,41 @@ extendedTest()
rm $tmp
}
##
# http://stackoverflow.com/questions/1055671/how-can-i-get-the-behavior-of-gnus-readlink-f-on-a-mac
real_path ()
{
OIFS=$IFS
IFS='/'
for I in $1; do
# Resolve relative path punctuation.
if [ "$I" = "." ] || [ -z "$I" ]; then
continue
elif [ "$I" = ".." ]; then
FOO="${FOO%%/${FOO##*/}}"
continue
else
FOO="${FOO}/${I}"
fi
## Resolve symbolic links
if [ -h "$FOO" ]; then
IFS=$OIFS
set `ls -l "$FOO"`
while shift ; do
if [ "$1" = "->" ]; then
FOO=$2
shift $#
break
fi
done
IFS='/'
fi
done
IFS=$OIFS
echo "$FOO"
}
##
# prepare temp files and other variables
prepareTest()
@ -416,6 +451,18 @@ prepareTest()
da2=""
fi
diffargs="$da1 $da2"
##
# test that exiv2 and some sample apps are in the bin!
for e in exiv2 exifprint; do
e="${bin}/${e}${exe}"
if [ ! -e "$e" ]; then
echo '******************************************'
echo '***' $(real_path "$e") does not exist
echo '******************************************'
exit 42
fi
done
}
prepareTest

Loading…
Cancel
Save