Package: dh-r
Version: 20241218
Tags: patch
The 'generic' test runner (but not 'run-unit-test') runs tests/*.R with
the current directory at the package root. This fails for tests that
refer to other files and expect to be run from the tests directory (e.g.
this is standard for tests that use r-cran-testthat).
The one example I know of is r-cran-survminer (for which I have sent a
fix separately).
Fix:
--- a/scripts/dh-make-R
+++ b/scripts/dh-make-R
@@ -1545,7 +1545,8 @@ maybe_write("debian/salsa-ci.yml", $sals
my $test_generic = <<'EOF';
#!/bin/sh -e
-for testfile in tests/*.[Rr] ; do
+cd tests
+for testfile in *.[Rr] ; do
echo "BEGIN TEST $testfile"
LC_ALL=C.UTF-8 R --no-save < $testfile
done