From b1d7fa7a925b3f36ef3d7305c52b04241b3e9c62 Mon Sep 17 00:00:00 2001 From: Oliverpool Date: Thu, 22 Oct 2015 15:25:02 +0200 Subject: [PATCH] Use a placeholder for the test folder --- test/test_compilation/subdir.tex.control | 22 +++++++++++----------- test/test_compilation/test_compilation.py | 6 ++++++ 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/test/test_compilation/subdir.tex.control b/test/test_compilation/subdir.tex.control index c39bd82a..f3374e33 100644 --- a/test/test_compilation/subdir.tex.control +++ b/test/test_compilation/subdir.tex.control @@ -13,10 +13,10 @@ \makeatletter \def\input@path{ % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/subdir_datadir/latex/} % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/subdir_datadir2/latex/} % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/latex/} % - {/home/louis/projets/patacrep/patacrep/patacrep/data/latex/} % + {@TEST_FOLDER@/subdir_datadir/latex/} % + {@TEST_FOLDER@/subdir_datadir2/latex/} % + {@TEST_FOLDER@/latex/} % + {/home/travis/build/patacrep/patacrep/patacrep/data/latex/} % } \makeatother @@ -42,10 +42,10 @@ guitar, \usepackage{graphicx} \graphicspath{ % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/subdir_datadir/} % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/subdir_datadir2/} % - {/home/louis/projets/patacrep/patacrep/test/test_compilation/} % - {/home/louis/projets/patacrep/patacrep/patacrep/data/} % + {@TEST_FOLDER@/subdir_datadir/} % + {@TEST_FOLDER@/subdir_datadir2/} % + {@TEST_FOLDER@/} % + {/home/travis/build/patacrep/patacrep/patacrep/data/} % } @@ -160,15 +160,15 @@ Chordpro}[ Chordpro}[ by={ }, - cov={/home/louis/projets/patacrep/patacrep/test/test_compilation/subdir_datadir/songs/./relative.png}, + cov={@TEST_FOLDER@/subdir_datadir/songs/./relative.png}, ] \cover -\lilypond{/home/louis/projets/patacrep/patacrep/test/test_compilation/subdir_datadir/songs/./relative.ly} -\image{/home/louis/projets/patacrep/patacrep/test/test_compilation/subdir_datadir/songs/./relative.png} +\lilypond{@TEST_FOLDER@/subdir_datadir/songs/./relative.ly} +\image{@TEST_FOLDER@/subdir_datadir/songs/./relative.png} \endsong diff --git a/test/test_compilation/test_compilation.py b/test/test_compilation/test_compilation.py index 9f2fde79..159a821b 100644 --- a/test/test_compilation/test_compilation.py +++ b/test/test_compilation/test_compilation.py @@ -89,3 +89,9 @@ class FileTest(unittest.TestCase, metaclass=dynamic.DynamicTest): cwd=os.path.dirname(songbook), ) + def assertMultiLineEqual(self, result, expected): + """Replace the paths with the local paths""" + placeholder = "@TEST_FOLDER@" + localpath = os.path.dirname(__file__) + expected = expected.replace(placeholder, localpath) + return super().assertMultiLineEqual(result, expected)