| 1 | #!/bin/sh |
| 2 | |
| 3 | set -eu |
| 4 | |
| 5 | WORKDIR=$(mktemp -d) |
| 6 | |
| 7 | trap "rm -rf $WORKDIR" 0 INT QUIT ABRT PIPE TERM |
| 8 | |
| 9 | # Copy the source tree: |
| 10 | cp -r . $WORKDIR |
| 11 | cd $WORKDIR |
| 12 | |
| 13 | # Use installed binaries: |
| 14 | sed -i -e "s/-I\$(top_srcdir)[^[:blank:]]*/\$\$(pkg-config --cflags --libs ticonv)/" \ |
| 15 | -e "s/\$(top_builddir)[^[:blank:]]*/\$\$(pkg-config --libs ticonv)/" \ |
| 16 | -e "s/LDADD/LDFLAGS/" tests/Makefile.am |
| 17 | |
| 18 | # Clean if necessary: |
| 19 | if [ -f debian/autoreconf.before ]; then |
| 20 | dh_auto_clean |
| 21 | dh_autoreconf_clean |
| 22 | fi |
| 23 | |
| 24 | # Reconfigure: |
| 25 | dh_autoreconf |
| 26 | dh_auto_configure |
| 27 | |
| 28 | # Run the tests: |
| 29 | make check |
| 30 | |
| 31 | # Show if linked to the system's libs: |
| 32 | ldd tests/test_ticonv tests/torture_ticonv |
| 33 | |
| 34 | # Log the test output: |
| 35 | if [ -f tests/test-suite.log ]; then |
| 36 | cat tests/test-suite.log |
| 37 | fi |