diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/Makefile.am | 6 | ||||
-rwxr-xr-x | test/bigarray.test | 15 | ||||
-rwxr-xr-x | test/bigarraycmp.test | 13 | ||||
-rwxr-xr-x | test/empty.test | 15 | ||||
-rwxr-xr-x | test/emptycmp.test | 13 | ||||
-rwxr-xr-x | test/huge.test | 15 | ||||
-rwxr-xr-x | test/hugecmp.test | 13 | ||||
-rwxr-xr-x | test/large.test | 15 | ||||
-rwxr-xr-x | test/largecmp.test | 13 | ||||
-rwxr-xr-x | test/medium.test | 15 | ||||
-rwxr-xr-x | test/mediumcmp.test | 13 | ||||
-rw-r--r-- | test/plist_test.c | 6 | ||||
-rwxr-xr-x | test/small.test | 15 | ||||
-rwxr-xr-x | test/smallcmp.test | 13 |
14 files changed, 75 insertions, 105 deletions
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 |