diff options
author | Adriaan de Groot <groot@kde.org> | 2019-02-12 08:15:05 -0500 |
---|---|---|
committer | Adriaan de Groot <groot@kde.org> | 2019-02-12 08:15:05 -0500 |
commit | 496f9fdaf1f171df777f5628767f7f71bf2e1bea (patch) | |
tree | ddb7f86fb1422f8aac3d512e12f1889d5ec1e1d0 | |
parent | 9b3678396119ad7113e47df1194f596e5ef08044 (diff) |
[libcalamares] Fix tests
- The test wants to read settings.conf, but by default it's run
from way inside the build dir, where there is no such file.
Go looking for one (but not too far).
-rw-r--r-- | src/libcalamares/Tests.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libcalamares/Tests.cpp b/src/libcalamares/Tests.cpp index 102a18409..e8566887d 100644 --- a/src/libcalamares/Tests.cpp +++ b/src/libcalamares/Tests.cpp @@ -62,9 +62,13 @@ void LibCalamaresTests::testLoadSaveYaml() { QFile f( "settings.conf" ); + // Find the nearest settings.conf to read + for ( unsigned int up = 0; !f.exists() && ( up < 4 ); ++up ) + f.setFileName( QString( "../" ) + f.fileName() ); + cDebug() << QDir().absolutePath() << f.fileName() << f.exists(); QVERIFY( f.exists() ); - auto map = CalamaresUtils::loadYaml( "settings.conf" ); + auto map = CalamaresUtils::loadYaml( f.fileName() ); CalamaresUtils::saveYaml( "out.yaml", map ); auto other_map = CalamaresUtils::loadYaml( "out.yaml" ); |