From: David Lamparter Date: Sat, 18 Aug 2018 03:00:54 +0000 (+0200) Subject: tests: properly locate files in builddir X-Git-Tag: frr-6.0.1~18^2~30 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=e4472d12f7ece5c73e215582eab857b318431427;p=matthieu%2Ffrr.git 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 --- diff --git a/tests/helpers/python/frrtest.py b/tests/helpers/python/frrtest.py index da9e447fc0..60bee5c88c 100644 --- a/tests/helpers/python/frrtest.py +++ b/tests/helpers/python/frrtest.py @@ -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): diff --git a/tests/lib/cli/test_cli.py b/tests/lib/cli/test_cli.py index e3c31c2d91..7371db283a 100644 --- a/tests/lib/cli/test_cli.py +++ b/tests/lib/cli/test_cli.py @@ -2,3 +2,4 @@ import frrtest class TestCli(frrtest.TestRefOut): program = './test_cli' + built_refout = True