Skip to content

Commit

Permalink
Add tests for issue #9
Browse files Browse the repository at this point in the history
  • Loading branch information
samueltardieu committed Nov 12, 2016
1 parent fbb952c commit 7dd6f31
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ env:
- CFLAGS=-O2 CXXFLAGS=-O2
- CFLAGS="-O2 -pedantic -Wall -Wextra -Werror" CXXFLAGS="-O2 -pedantic -Wall -Wextra -Werror"
- CFLAGS=-O3 CXXFLAGS=-O3
script: autoreconf -f -i && ./configure && make
script: autoreconf -f -i && ./configure && make check
2 changes: 1 addition & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AUTOMAKE_OPTIONS = foreign
SUBDIRS = src doc scripts
SUBDIRS = src doc scripts tests

extra_DIST = ChangeLog

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ AM_INIT_AUTOMAKE
AC_CONFIG_HEADER([config.h])
AC_PROG_CC
AC_PROG_CXX
AC_CONFIG_FILES([Makefile src/Makefile scripts/Makefile doc/Makefile])
AC_CONFIG_FILES([Makefile src/Makefile scripts/Makefile doc/Makefile tests/Makefile])
AC_OUTPUT
6 changes: 6 additions & 0 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
TESTS = chdir-ok.test chdir-not-ok.test
XFAIL_TESTS = chdir-not-ok.test

EXTRA_DIST = *.test

never::
9 changes: 9 additions & 0 deletions tests/chdir-not-ok.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#! /bin/sh
#

RECOVERJPEG="$PWD/../src/recoverjpeg"
trap "rm -rf $PWD/$0.dir" INT QUIT TERM EXIT
mkdir "$0.dir"
cd "$0.dir"

${RECOVERJPEG} -o foo ${RECOVERJPEG}
10 changes: 10 additions & 0 deletions tests/chdir-ok.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#! /bin/sh
#

RECOVERJPEG="$PWD/../src/recoverjpeg"
trap "rm -rf $PWD/$0.dir" INT QUIT TERM EXIT
mkdir "$0.dir"
cd "$0.dir"

mkdir -p foo/bar
${RECOVERJPEG} -o foo -o bar ${RECOVERJPEG}

0 comments on commit 7dd6f31

Please sign in to comment.