make sure the test data exists, I guess
This commit is contained in:
parent
95cd22613f
commit
d13176070f
|
@ -4,7 +4,7 @@ MANPAGE := libdirutils.3
|
||||||
OBJS := dirutils.o dirlist.o dirwalk.o
|
OBJS := dirutils.o dirlist.o dirwalk.o
|
||||||
HEADERS := kst
|
HEADERS := kst
|
||||||
LIBS :=
|
LIBS :=
|
||||||
TEST_LIBS := -L/usr/local/lib -lcunit
|
TEST_LIBS := -L/usr/local/lib OS_TEST_LIBS -lcunit
|
||||||
|
|
||||||
PREFIX ?= $PREFIX
|
PREFIX ?= $PREFIX
|
||||||
MANDIR ?= $MANDIR
|
MANDIR ?= $MANDIR
|
||||||
|
|
|
@ -13,6 +13,9 @@ OPSYS=$(uname -s)
|
||||||
echo "Configuring for ${OPSYS}..."
|
echo "Configuring for ${OPSYS}..."
|
||||||
if [ "x${OPSYS}" = "xLinux" ]; then
|
if [ "x${OPSYS}" = "xLinux" ]; then
|
||||||
OS_CFLAGS="-D_DEFAULT_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE"
|
OS_CFLAGS="-D_DEFAULT_SOURCE -D_POSIX_SOURCE -D_XOPEN_SOURCE"
|
||||||
|
elif [ "x${OPSYS}" = "xDarwin" ]; then
|
||||||
|
OS_CFLAGS="-I/opt/homebrew/include"
|
||||||
|
OS_TEST_LIBS="-L/opt/homebrew/lib"
|
||||||
else
|
else
|
||||||
OS_CFLAGS=""
|
OS_CFLAGS=""
|
||||||
fi
|
fi
|
||||||
|
@ -43,7 +46,8 @@ echo "prefix: ${PREFIX}"
|
||||||
echo "mandir: ${MANDIR}"
|
echo "mandir: ${MANDIR}"
|
||||||
|
|
||||||
echo "writing new Makefile"
|
echo "writing new Makefile"
|
||||||
cat Makefile.in | sed -e "s|OS_CFLAGS|${OS_CFLAGS}|" | \
|
cat Makefile.in | sed -e "s|OS_CFLAGS|${OS_CFLAGS}|" | \
|
||||||
|
sed -e "s|OS_TEST_LIBS|${OS_TEST_LIBS}|" | \
|
||||||
sed -e "s|\$PREFIX|${PREFIX}|" | \
|
sed -e "s|\$PREFIX|${PREFIX}|" | \
|
||||||
sed -e "s|\$MANDIR|${MANDIR}|" > Makefile
|
sed -e "s|\$MANDIR|${MANDIR}|" > Makefile
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,10 @@ test_exists(void)
|
||||||
char testnot[] = "testdata/nosuchfile";
|
char testnot[] = "testdata/nosuchfile";
|
||||||
EXISTS_STATUS ftype;
|
EXISTS_STATUS ftype;
|
||||||
|
|
||||||
|
|
||||||
|
system("mkdir -p testdata/testdir");
|
||||||
|
system("touch testdata/testfile");
|
||||||
|
|
||||||
ftype = path_exists(testdir);
|
ftype = path_exists(testdir);
|
||||||
CU_ASSERT(EXISTS_DIR == ftype);
|
CU_ASSERT(EXISTS_DIR == ftype);
|
||||||
|
|
||||||
|
@ -54,6 +58,9 @@ test_exists(void)
|
||||||
|
|
||||||
ftype = path_exists(testnot);
|
ftype = path_exists(testnot);
|
||||||
CU_ASSERT(EXISTS_NOENT == ftype);
|
CU_ASSERT(EXISTS_NOENT == ftype);
|
||||||
|
|
||||||
|
system("rm -r testdata/testdir");
|
||||||
|
system("rm testdata/testfile");
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
Loading…
Reference in New Issue