summaryrefslogtreecommitdiffstats
path: root/tests/testgitstorage.cpp
diff options
context:
space:
mode:
authorGravatar Jeremie Guichard <djebrest@gmail.com>2017-02-24 13:52:07 +0700
committerGravatar Dirk Hohndel <dirk@hohndel.org>2017-02-24 01:10:22 -0800
commit1e2580c3fd73d5b1ca06ecc870f38c43dfc4abe8 (patch)
tree393fe706bb12c962915726ee624fdf1718e48789 /tests/testgitstorage.cpp
parent5b8bde8e1e97ea597c28e52e88fbc9475e6ea294 (diff)
downloadsubsurface-1e2580c3fd73d5b1ca06ecc870f38c43dfc4abe8.tar.gz
Use SUBSURFACE_TEST_DATA definition to point to test data dir
Update tests with a (compile time) option SUBSURFACE_TEST_DATA, pointing to test data base path. It is needed for cross compilation cases. SUBSURFACE_TEST_DATA is set to SUBSURFACE_SOURCE by default, or configurable via cmake option -DSUBSURFACE_TEST_DATA="...". Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
Diffstat (limited to 'tests/testgitstorage.cpp')
-rw-r--r--tests/testgitstorage.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/testgitstorage.cpp b/tests/testgitstorage.cpp
index 038209534..8d7558f7c 100644
--- a/tests/testgitstorage.cpp
+++ b/tests/testgitstorage.cpp
@@ -64,7 +64,7 @@ void TestGitStorage::testGitStorageLocal()
// test writing and reading back from local git storage
git_repository *repo;
git_libgit2_init();
- QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/SampleDivesV2.ssrf"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf"), 0);
QString testDirName("./gittest");
QDir testDir(testDirName);
QCOMPARE(testDir.removeRecursively(), true);
@@ -93,7 +93,7 @@ void TestGitStorage::testGitStorageCloud()
// connect to the ssrftest repository on the cloud server
// and repeat the same test as before with the local git storage
QString cloudTestRepo("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org[ssrftest@hohndel.org]");
- QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/SampleDivesV2.ssrf"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/SampleDivesV2.ssrf"), 0);
QCOMPARE(save_dives(qPrintable(cloudTestRepo)), 0);
clear_dive_file_data();
QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0);
@@ -119,7 +119,7 @@ void TestGitStorage::testGitStorageCloudOfflineSync()
QString localCacheRepo = localCacheDir + "[ssrftest@hohndel.org]";
// read the local repo from the previous test and add dive 10
QCOMPARE(parse_file(qPrintable(localCacheRepo)), 0);
- QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test10.xml"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test10.xml"), 0);
// calling process_dive() sorts the table, but calling it with
// is_imported == true causes it to try to update the window title... let's not do that
process_dives(false, false);
@@ -169,14 +169,14 @@ void TestGitStorage::testGitStorageCloudMerge()
QString localCacheDir(get_local_dir("https://cloud.subsurface-divelog.org/git/ssrftest@hohndel.org", "ssrftest@hohndel.org"));
QString localCacheRepoSave = localCacheDir + "save[ssrftest@hohndel.org]";
QCOMPARE(parse_file(qPrintable(localCacheRepoSave)), 0);
- QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test11.xml"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test11.xml"), 0);
process_dives(false, false);
QCOMPARE(save_dives(qPrintable(localCacheRepoSave)), 0);
clear_dive_file_data();
// now we open the cloud storage repo and add a different dive to it
QCOMPARE(parse_file(qPrintable(cloudTestRepo)), 0);
- QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test12.xml"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test12.xml"), 0);
process_dives(false, false);
QCOMPARE(save_dives(qPrintable(cloudTestRepo)), 0);
clear_dive_file_data();
@@ -191,9 +191,9 @@ void TestGitStorage::testGitStorageCloudMerge()
QCOMPARE(save_dives("./SapleDivesV3plus10-11-12-merged.ssrf"), 0);
clear_dive_file_data();
QCOMPARE(parse_file("./SampleDivesV3plus10local.ssrf"), 0);
- QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test11.xml"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test11.xml"), 0);
process_dives(false, false);
- QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/test12.xml"), 0);
+ QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/test12.xml"), 0);
process_dives(false, false);
QCOMPARE(save_dives("./SapleDivesV3plus10-11-12.ssrf"), 0);
QFile org("./SapleDivesV3plus10-11-12-merged.ssrf");