File: run-unit-test

package info (click to toggle)
r-cran-openmx 2.21.1%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 14,412 kB
  • sloc: cpp: 36,577; ansic: 13,811; fortran: 2,001; sh: 1,440; python: 350; perl: 21; makefile: 5
file content (52 lines) | stat: -rw-r--r-- 1,512 bytes parent folder | download | duplicates (2)
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/sh -e

pkgname=OpenMx
debname=r-cran-openmx

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 *
cd tests

hostarch=$(dpkg-architecture -qDEB_HOST_ARCH)
# Ignore single test on armhf and arm64
if [ "$hostarch" = "armhf" ] ; then
cat <<EOT
Clarify issue with upstream or armhf porter team:
=================================================
> library(OpenMx)
To take full advantage of multiple cores, use:
  mxOption(key='Number of Threads', value=parallel::detectCores()) #now
  Sys.setenv(OMP_NUM_THREADS=parallel::detectCores()) #before library(OpenMx)
> 
> test_check("OpenMx")
terminate called after throwing an instance of 'std::runtime_error'
  what():  Problem in dVnames mapping
Aborted

EOT
exit 0
fi
if [ "$hostarch" = "arm64" -o "$hostarch" = "i386" ] ; then
  sed -i -e '/^test_that."RAM"/,/^})/d' \
         -e '/^test_that."mediation"/,/^})/d' \
         -e '/^test_that."LISREL"/,/^})/d' \
         -e '/^test_that."probit+poisson ML+WLS"/,/^})/d' testthat/test-discrete.R
  if [ "$hostarch" = "i386" ] ; then
    sed -i -e '/^expect_error(mxRun(wlsTest4)/,$d' testthat/test-wls-binary.R
  fi
fi

if [ "$hostarch" = "i386" -o "$hostarch" = "ppc64el" ] ; then
  rm -f testthat/test-cor.R
fi

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