summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Nikias Bassen2014-02-13 12:14:31 +0100
committerGravatar Nikias Bassen2014-02-13 12:14:31 +0100
commit8867ee930606a2d9126b742b1c5ad7a8fa425190 (patch)
treecd68fba84007c810a184e48360ddb78a2f2ed389
parent497a5980d837e212f2444688dce72c6080762280 (diff)
downloadlibplist-8867ee930606a2d9126b742b1c5ad7a8fa425190.tar.gz
libplist-8867ee930606a2d9126b742b1c5ad7a8fa425190.tar.bz2
fix make distcheck
-rw-r--r--libcnary/Makefile.am2
-rw-r--r--src/Makefile.am6
-rw-r--r--test/Makefile.am6
-rwxr-xr-xtest/bigarray.test15
-rwxr-xr-xtest/bigarraycmp.test13
-rwxr-xr-xtest/empty.test15
-rwxr-xr-xtest/emptycmp.test13
-rwxr-xr-xtest/huge.test15
-rwxr-xr-xtest/hugecmp.test13
-rwxr-xr-xtest/large.test15
-rwxr-xr-xtest/largecmp.test13
-rwxr-xr-xtest/medium.test15
-rwxr-xr-xtest/mediumcmp.test13
-rw-r--r--test/plist_test.c6
-rwxr-xr-xtest/small.test15
-rwxr-xr-xtest/smallcmp.test13
16 files changed, 79 insertions, 109 deletions
diff --git a/libcnary/Makefile.am b/libcnary/Makefile.am
index ef61c31..bba9ada 100644
--- a/libcnary/Makefile.am
+++ b/libcnary/Makefile.am
@@ -1,4 +1,4 @@
-AM_CFLAGS = $(GLOBAL_CFLAGS) -Iinclude
+AM_CFLAGS = $(GLOBAL_CFLAGS) -I$(top_srcdir)/libcnary/include
AM_LDFLAGS =
noinst_LTLIBRARIES = libcnary.la
diff --git a/src/Makefile.am b/src/Makefile.am
index 16cf655..cbb9b87 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -4,14 +4,14 @@ AM_CFLAGS = $(GLOBAL_CFLAGS) $(libxml2_CFLAGS)
AM_LDFLAGS = $(libxml2_LIBS)
lib_LTLIBRARIES = libplist.la libplist++.la
-libplist_la_LIBADD = $(top_srcdir)/libcnary/libcnary.la
+libplist_la_LIBADD = $(top_builddir)/libcnary/libcnary.la
libplist_la_LDFLAGS = $(AM_LDFLAGS) -version-info $(LIBPLIST_SO_VERSION) -no-undefined
libplist_la_SOURCES = base64.c base64.h \
bytearray.c bytearray.h \
hashtable.c hashtable.h \
ptrarray.c ptrarray.h \
- xplist.c xplist.h \
- bplist.c bplist.h \
+ xplist.c \
+ bplist.c \
plist.c plist.h \
common.h
diff --git a/test/Makefile.am b/test/Makefile.am
index 837c1dd..d508380 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -23,3 +23,9 @@ TESTS = \
hugecmp.test \
bigarraycmp.test
+EXTRA_DIST = $(TESTS) data/1.plist data/2.plist data/3.plist data/4.plist data/5.plist data/6.plist
+
+TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) top_builddir=$(top_builddir)
+
+clean-local:
+ rm -f $(top_builddir)/test/data/*.out
diff --git a/test/bigarray.test b/test/bigarray.test
index fa27e69..27f8098 100755
--- a/test/bigarray.test
+++ b/test/bigarray.test
@@ -1,12 +1,11 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=6.plist
-$srcdir/plist_test $srcdir/data/6.plist
+if ! test -d "$DATAOUT"; then
+ mkdir -p $DATAOUT
+fi
+$top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/bigarraycmp.test b/test/bigarraycmp.test
index f95266e..1c11336 100755
--- a/test/bigarraycmp.test
+++ b/test/bigarraycmp.test
@@ -1,12 +1,7 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
-
-$srcdir/plist_cmp $srcdir/data/6.plist $srcdir/data/6.plist.out
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=6.plist
+$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/empty.test b/test/empty.test
index 2a036a3..d092ee3 100755
--- a/test/empty.test
+++ b/test/empty.test
@@ -1,12 +1,11 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=1.plist
-$srcdir/plist_test $srcdir/data/1.plist
+if ! test -d "$DATAOUT"; then
+ mkdir -p $DATAOUT
+fi
+$top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/emptycmp.test b/test/emptycmp.test
index 9fcd685..2496866 100755
--- a/test/emptycmp.test
+++ b/test/emptycmp.test
@@ -1,12 +1,7 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
-
-$srcdir/plist_cmp $srcdir/data/1.plist $srcdir/data/1.plist.out
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=1.plist
+$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/huge.test b/test/huge.test
index a079d38..f4ea9bf 100755
--- a/test/huge.test
+++ b/test/huge.test
@@ -1,12 +1,11 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=5.plist
-$srcdir/plist_test $srcdir/data/5.plist
+if ! test -d "$DATAOUT"; then
+ mkdir -p $DATAOUT
+fi
+$top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/hugecmp.test b/test/hugecmp.test
index 618966d..dfdff52 100755
--- a/test/hugecmp.test
+++ b/test/hugecmp.test
@@ -1,12 +1,7 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
-
-$srcdir/plist_cmp $srcdir/data/5.plist $srcdir/data/5.plist.out
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=5.plist
+$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/large.test b/test/large.test
index 8034019..dfe05d0 100755
--- a/test/large.test
+++ b/test/large.test
@@ -1,12 +1,11 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=4.plist
-$srcdir/plist_test $srcdir/data/4.plist
+if ! test -d "$DATAOUT"; then
+ mkdir -p $DATAOUT
+fi
+$top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/largecmp.test b/test/largecmp.test
index 87a7e64..922be36 100755
--- a/test/largecmp.test
+++ b/test/largecmp.test
@@ -1,12 +1,7 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
-
-$srcdir/plist_cmp $srcdir/data/4.plist $srcdir/data/4.plist.out
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=4.plist
+$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/medium.test b/test/medium.test
index 231bb80..6740599 100755
--- a/test/medium.test
+++ b/test/medium.test
@@ -1,12 +1,11 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=3.plist
-$srcdir/plist_test $srcdir/data/3.plist
+if ! test -d "$DATAOUT"; then
+ mkdir -p $DATAOUT
+fi
+$top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/mediumcmp.test b/test/mediumcmp.test
index 33802ef..9eff0da 100755
--- a/test/mediumcmp.test
+++ b/test/mediumcmp.test
@@ -1,12 +1,7 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
-
-$srcdir/plist_cmp $srcdir/data/3.plist $srcdir/data/3.plist.out
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=3.plist
+$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/plist_test.c b/test/plist_test.c
index 17be11a..b498e1d 100644
--- a/test/plist_test.c
+++ b/test/plist_test.c
@@ -44,14 +44,16 @@ int main(int argc, char *argv[])
uint32_t size_out = 0;
uint32_t size_out2 = 0;
char *file_in = NULL;
+ char *file_out = NULL;
struct stat *filestats = (struct stat *) malloc(sizeof(struct stat));
- if (argc!= 2)
+ if (argc != 3)
{
printf("Wrong input\n");
return 1;
}
file_in = argv[1];
+ file_out = argv[2];
//read input file
iplist = fopen(file_in, "rb");
@@ -108,8 +110,6 @@ int main(int argc, char *argv[])
if (plist_xml2)
{
FILE *oplist = NULL;
- char file_out[512];
- sprintf(file_out, "%s.out", file_in);
oplist = fopen(file_out, "wb");
fwrite(plist_xml2, size_out2, sizeof(char), oplist);
fclose(oplist);
diff --git a/test/small.test b/test/small.test
index 544f374..d84782a 100755
--- a/test/small.test
+++ b/test/small.test
@@ -1,12 +1,11 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=2.plist
-$srcdir/plist_test $srcdir/data/2.plist
+if ! test -d "$DATAOUT"; then
+ mkdir -p $DATAOUT
+fi
+$top_builddir/test/plist_test $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out
diff --git a/test/smallcmp.test b/test/smallcmp.test
index fb10787..461a8e6 100755
--- a/test/smallcmp.test
+++ b/test/smallcmp.test
@@ -1,12 +1,7 @@
## -*- sh -*-
-# Common definitions
-if test -z "$srcdir"; then
- srcdir=echo "$0" | sed 's,[^/]*$,,'
- test "$srcdir" = "$0" && srcdir=.
- test -z "$srcdir" && srcdir=.
- test "${VERBOSE+set}" != set && VERBOSE=1
-fi
-
-$srcdir/plist_cmp $srcdir/data/2.plist $srcdir/data/2.plist.out
+DATASRC=$top_srcdir/test/data
+DATAOUT=$top_builddir/test/data
+TESTFILE=2.plist
+$top_builddir/test/plist_cmp $DATASRC/$TESTFILE $DATAOUT/$TESTFILE.out