Make test suite work once copied out of the build tree
Debian now has autopkgtest (http://dep.debian.net/deps/dep8/), that are very useful to detect e.g. when a dependency update breaks a package, or when runtime dependencies are missing. Ideally one would write real integration tests meant to be run against the installed package, but a first step when adding autopkgtests for a given package is often to simply run the existing upstream test suite against the installed package.
I've tried copying the
test directory out of the source tree and to run
test.py, but in the current state of things it doesn't work: the test suite hardcodes things like
../mat.desktop. Would it be possible to fall back to the location where these files are installed, whenever the test suite detects it is not running from inside the source tree?
#2 Updated by intrigeri over 4 years ago
Just to be sure, you want the testsuite to run against the current, system-wide, installed version of MAT?
Exactly. DEP-8's abstract reads: "Establish a standard interface to define and run "as-installed" tests of packages, i.e. the testing of packages in a context as close as possible to a Debian system where the packages subject to testing are properly installed."
#4 Updated by intrigeri over 4 years ago
- QA Check set to Dev Needed
I just pushed some changes to allows that.
Please test :)
The way it's implemented in
test/libtest.py works for me, but the way it's implemented in
test/clitest.py keeps failing.
This fixes it for me:
--- a/test/clitest.py +++ b/test/clitest.py @@ -16,7 +16,6 @@ MAT_PATH = 'mat' if test.IS_LOCAL is True: # Are we testing the _local_ version of MAT? sys.path.insert(0, '..') - MAT_PATH = '../mat' # else it will be in the path from libmat import mat
FYI you can test it the same as I do with
cp -a test /tmp/bla && cd /tmp/bla && python test.py --system :)
Also see the subtask I've created about missing doc updates.
#6 Updated by intrigeri over 4 years ago
This fixes it for me:
Well, no: it fixes the
--system use case for wrong reasons (
if test.IS_LOCAL is True is always verified, even when passing
--system), and it breaks the
--local use case. So I guess you'll need to find a better way to pass the
--system info from