tests: properly locate files in builddir

test_cli.refout is written by configure into the build directory, thus
we need a little special glue to find it correctly.

Signed-off-by: David Lamparter <equinox@diac24.net>
This commit is contained in:
David Lamparter 2018-08-18 05:00:54 +02:00 committed by David Lamparter
parent 74dc19a2f5
commit b37ccace1e
2 changed files with 9 additions and 2 deletions

View File

@ -176,8 +176,14 @@ class TestRefOut(object):
basedir = os.path.dirname(inspect.getsourcefile(type(self)))
program = os.path.join(basedir, self.program)
refin = program + '.in'
refout = program + '.refout'
if getattr(self, 'built_refin', False):
refin = binpath(program) + '.in'
else:
refin = program + '.in'
if getattr(self, 'built_refout', False):
refout = binpath(program) + '.refout'
else:
refout = program + '.refout'
intext = ''
if os.path.exists(refin):

View File

@ -2,3 +2,4 @@ import frrtest
class TestCli(frrtest.TestRefOut):
program = './test_cli'
built_refout = True