forked from Mirror/frr
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:
parent
74dc19a2f5
commit
b37ccace1e
|
@ -176,8 +176,14 @@ class TestRefOut(object):
|
||||||
basedir = os.path.dirname(inspect.getsourcefile(type(self)))
|
basedir = os.path.dirname(inspect.getsourcefile(type(self)))
|
||||||
program = os.path.join(basedir, self.program)
|
program = os.path.join(basedir, self.program)
|
||||||
|
|
||||||
refin = program + '.in'
|
if getattr(self, 'built_refin', False):
|
||||||
refout = program + '.refout'
|
refin = binpath(program) + '.in'
|
||||||
|
else:
|
||||||
|
refin = program + '.in'
|
||||||
|
if getattr(self, 'built_refout', False):
|
||||||
|
refout = binpath(program) + '.refout'
|
||||||
|
else:
|
||||||
|
refout = program + '.refout'
|
||||||
|
|
||||||
intext = ''
|
intext = ''
|
||||||
if os.path.exists(refin):
|
if os.path.exists(refin):
|
||||||
|
|
|
@ -2,3 +2,4 @@ import frrtest
|
||||||
|
|
||||||
class TestCli(frrtest.TestRefOut):
|
class TestCli(frrtest.TestRefOut):
|
||||||
program = './test_cli'
|
program = './test_cli'
|
||||||
|
built_refout = True
|
||||||
|
|
Loading…
Reference in a new issue