File: run-unit-test

package info (click to toggle)
r-cran-lifecycle 1.0.4%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 576 kB
  • sloc: sh: 15; makefile: 2
file content (26 lines) | stat: -rw-r--r-- 750 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#!/bin/sh -e

pkgname=lifecycle
debname=r-cran-lifecycle

if [ "$AUTOPKGTEST_TMP" = "" ] ; then
    AUTOPKGTEST_TMP=`mktemp -d /tmp/${debname}-test.XXXXXX`
    trap "rm -rf $AUTOPKGTEST_TMP" 0 INT QUIT ABRT PIPE TERM
fi
cd $AUTOPKGTEST_TMP
cp -a /usr/share/doc/$debname/tests/* $AUTOPKGTEST_TMP
gunzip -r *

# FIXME: Hack around a problematic test
# One test results in
#       -- 1. Error: Searches with entities work (#241) (@test-xml_find.R#136)  --------
#       Can't find `tests/testthat` in current directory.
# The following circumvents this by some not so clean trick
mkdir testthat/tests
ln -s $(pwd)/testthat testthat/tests/testthat

for testfile in *.R; do
    echo "BEGIN TEST $testfile"
    LC_ALL=C.UTF-8 R --no-save < $testfile
done