aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2016-04-14 01:23:54 +0200
committerPetr Mrázek <peterix@gmail.com>2016-05-01 00:02:15 +0200
commit771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d (patch)
tree52962ddf547b3227f1b637dd1da2b3d0b5a5a766
parente8ba5dafc63de65ed8a469353b808e391633f0fc (diff)
downloadPrismLauncher-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.tar.gz
PrismLauncher-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.tar.bz2
PrismLauncher-771dd6f9abe29c1d24c5ea8f0e7ca949bc24f84d.zip
NOISSUE reorganize unit tests to be placed next to the code they test. Nuke more dead tests.
-rw-r--r--.gitattributes1
-rw-r--r--CMakeLists.txt8
-rw-r--r--api/gui/CMakeLists.txt2
-rw-r--r--api/logic/CMakeLists.txt220
-rw-r--r--api/logic/FileSystem_test.cpp (renamed from tests/tst_FileSystem.cpp)51
-rw-r--r--api/logic/GZip_test.cpp (renamed from tests/tst_GZip.cpp)2
-rw-r--r--api/logic/Version_test.cpp (renamed from tests/tst_modutils.cpp)2
-rw-r--r--api/logic/java/JavaVersion_test.cpp (renamed from tests/tst_JavaVersion.cpp)6
-rw-r--r--api/logic/minecraft/GradleSpecifier_test.cpp (renamed from tests/tst_gradlespecifier.cpp)2
-rw-r--r--api/logic/minecraft/Library_test.cpp (renamed from tests/tst_Library.cpp)2
-rw-r--r--api/logic/minecraft/ModList_test.cpp (renamed from tests/tst_ModList.cpp)4
-rw-r--r--api/logic/minecraft/MojangVersionFormat_test.cpp (renamed from tests/tst_MojangVersionFormat.cpp)6
-rw-r--r--api/logic/minecraft/ParseUtils_test.cpp (renamed from tests/tst_ParseUtils.cpp)2
-rw-r--r--api/logic/minecraft/testdata/1.9-simple.json (renamed from tests/data/1.9-simple.json)0
-rw-r--r--api/logic/minecraft/testdata/1.9.json (renamed from tests/data/1.9.json)0
-rw-r--r--api/logic/minecraft/testdata/lib-native-arch.json (renamed from tests/data/lib-native-arch.json)0
-rw-r--r--api/logic/minecraft/testdata/lib-native.json (renamed from tests/data/lib-native.json)0
-rw-r--r--api/logic/minecraft/testdata/lib-simple.json (renamed from tests/data/lib-simple.json)0
-rw-r--r--api/logic/settings/INIFile_test.cpp (renamed from tests/tst_inifile.cpp)2
-rwxr-xr-xapi/logic/testdata/FileSystem-test_createShortcut-unix (renamed from tests/data/tst_userutils-test_createShortcut-unix)0
-rw-r--r--api/logic/testdata/test_folder/assets/minecraft/textures/blah.txt (renamed from tests/data_raw/test_folder/assets/minecraft/textures/blah.txt)0
-rw-r--r--api/logic/testdata/test_folder/pack.mcmeta (renamed from tests/data_raw/test_folder/pack.mcmeta)0
-rw-r--r--api/logic/testdata/test_folder/pack.nfo (renamed from tests/data_raw/test_folder/pack.nfo)0
-rw-r--r--api/logic/updater/DownloadTask_test.cpp (renamed from tests/tst_DownloadTask.cpp)32
-rw-r--r--api/logic/updater/UpdateChecker_test.cpp (renamed from tests/tst_UpdateChecker.cpp)20
-rw-r--r--api/logic/updater/testdata/1.json (renamed from tests/data/1.json)0
-rw-r--r--api/logic/updater/testdata/2.json (renamed from tests/data/2.json)0
-rw-r--r--api/logic/updater/testdata/channels.json (renamed from tests/data/channels.json)0
-rw-r--r--api/logic/updater/testdata/errorChannels.json (renamed from tests/data/errorChannels.json)0
-rw-r--r--api/logic/updater/testdata/fileOneA (renamed from tests/data/fileOneA)0
-rw-r--r--api/logic/updater/testdata/fileOneB (renamed from tests/data/fileOneB)0
-rw-r--r--api/logic/updater/testdata/fileThree (renamed from tests/data/fileThree)0
-rw-r--r--api/logic/updater/testdata/fileTwo (renamed from tests/data/fileTwo)0
-rw-r--r--api/logic/updater/testdata/garbageChannels.json (renamed from tests/data/garbageChannels.json)0
-rw-r--r--api/logic/updater/testdata/index.json (renamed from tests/data/index.json)0
-rw-r--r--api/logic/updater/testdata/noChannels.json (renamed from tests/data/noChannels.json)0
-rw-r--r--api/logic/updater/testdata/oneChannel.json (renamed from tests/data/oneChannel.json)0
-rw-r--r--api/logic/updater/testdata/tst_DownloadTask-test_writeInstallScript.xml (renamed from tests/data/tst_DownloadTask-test_writeInstallScript.xml)0
-rw-r--r--api/logic/wonko/WonkoIndex_test.cpp (renamed from tests/tst_WonkoIndex.cpp)2
-rw-r--r--cmake/UnitTest.cmake14
-rw-r--r--cmake/UnitTest/generate_test_data.cmake3
-rw-r--r--tests/CMakeLists.txt82
-rw-r--r--tests/data/.gitattributes2
-rw-r--r--tests/tst_filematchers.cpp37
-rw-r--r--tests/tst_userutils.cpp70
45 files changed, 267 insertions, 305 deletions
diff --git a/.gitattributes b/.gitattributes
index 2a31189d..c9c0d50e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1 +1,2 @@
*.pem -crlf
+**/testdata/** -text -diff
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 3db0df73..d6acf79b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -20,12 +20,6 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
######## Set module path ########
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/cmake/")
-# Output all executables and shared libs in the main build folder, not in subfolders.
-set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
-if(UNIX)
- set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${PROJECT_BINARY_DIR})
-endif()
-
set(CMAKE_JAVA_TARGET_OUTPUT_DIR ${PROJECT_BINARY_DIR}/jars)
######## Set compiler flags ########
@@ -103,8 +97,6 @@ add_subdirectory(libraries/iconfix) # fork of Qt's QIcon loader
############################### Built Artifacts ###############################
-add_subdirectory(tests)
-
add_subdirectory(api/logic)
add_subdirectory(api/gui)
diff --git a/api/gui/CMakeLists.txt b/api/gui/CMakeLists.txt
index 1551a927..39cd5895 100644
--- a/api/gui/CMakeLists.txt
+++ b/api/gui/CMakeLists.txt
@@ -1,4 +1,4 @@
-project(MultiMC_logic)
+project(MultiMC_gui LANGUAGES CXX)
set(GUI_SOURCES
DesktopServices.h
diff --git a/api/logic/CMakeLists.txt b/api/logic/CMakeLists.txt
index abae7b90..b534f970 100644
--- a/api/logic/CMakeLists.txt
+++ b/api/logic/CMakeLists.txt
@@ -1,6 +1,8 @@
project(MultiMC_logic)
-set(LOGIC_SOURCES
+include (UnitTest)
+
+set(CORE_SOURCES
# LOGIC - Base classes and infrastructure
BaseInstaller.h
BaseInstaller.cpp
@@ -42,12 +44,6 @@ set(LOGIC_SOURCES
# a smart pointer wrapper intended for safer use with Qt signal/slot mechanisms
QObjectPtr.h
- # Path matchers
- pathmatcher/FSTreeMatcher.h
- pathmatcher/IPathMatcher.h
- pathmatcher/MultiMatcher.h
- pathmatcher/RegexpMatcher.h
-
# Compression support
GZip.h
GZip.cpp
@@ -60,6 +56,31 @@ set(LOGIC_SOURCES
Version.h
Version.cpp
+ # A Recursive file system watcher
+ RecursiveFileSystemWatcher.h
+ RecursiveFileSystemWatcher.cpp
+)
+
+add_unit_test(FileSystem
+ SOURCES FileSystem_test.cpp
+ LIBS MultiMC_logic
+ DATA testdata
+ )
+
+add_unit_test(GZip
+ SOURCES GZip_test.cpp
+ LIBS MultiMC_logic
+ )
+
+set(PATHMATCHER_SOURCES
+ # Path matchers
+ pathmatcher/FSTreeMatcher.h
+ pathmatcher/IPathMatcher.h
+ pathmatcher/MultiMatcher.h
+ pathmatcher/RegexpMatcher.h
+)
+
+set(NET_SOURCES
# network stuffs
net/NetAction.h
net/MD5EtagDownload.h
@@ -76,24 +97,10 @@ set(LOGIC_SOURCES
net/PasteUpload.cpp
net/URLConstants.h
net/URLConstants.cpp
+)
- # Yggdrasil login stuff
- minecraft/auth/AuthSession.h
- minecraft/auth/AuthSession.cpp
- minecraft/auth/MojangAccountList.h
- minecraft/auth/MojangAccountList.cpp
- minecraft/auth/MojangAccount.h
- minecraft/auth/MojangAccount.cpp
- minecraft/auth/YggdrasilTask.h
- minecraft/auth/YggdrasilTask.cpp
- minecraft/auth/flows/AuthenticateTask.h
- minecraft/auth/flows/AuthenticateTask.cpp
- minecraft/auth/flows/RefreshTask.cpp
- minecraft/auth/flows/RefreshTask.cpp
- minecraft/auth/flows/ValidateTask.h
- minecraft/auth/flows/ValidateTask.cpp
-
- # Game launch logic
+# Game launch logic
+set(LAUNCH_SOURCES
launch/steps/PostLaunchCommand.cpp
launch/steps/PostLaunchCommand.h
launch/steps/PreLaunchCommand.cpp
@@ -110,30 +117,70 @@ set(LOGIC_SOURCES
launch/LoggedProcess.h
launch/MessageLevel.cpp
launch/MessageLevel.h
+)
- # Update system
+# Old update system
+set(UPDATE_SOURCES
updater/GoUpdate.h
updater/GoUpdate.cpp
updater/UpdateChecker.h
updater/UpdateChecker.cpp
updater/DownloadTask.h
updater/DownloadTask.cpp
+)
+
+add_unit_test(UpdateChecker
+ SOURCES updater/UpdateChecker_test.cpp
+ LIBS MultiMC_logic
+ DATA updater/testdata
+ )
+
+add_unit_test(DownloadTask
+ SOURCES updater/DownloadTask_test.cpp
+ LIBS MultiMC_logic
+ DATA updater/testdata
+ )
+# Rarely used notifications
+set(NOTIFICATIONS_SOURCES
# Notifications - short warning messages
notifications/NotificationChecker.h
notifications/NotificationChecker.cpp
+)
+# Backend for the news bar... there's usually no news.
+set(NEWS_SOURCES
# News System
news/NewsChecker.h
news/NewsChecker.cpp
news/NewsEntry.h
news/NewsEntry.cpp
+)
+# Minecraft services status checker
+set(STATUS_SOURCES
# Status system
status/StatusChecker.h
status/StatusChecker.cpp
+)
+# Support for Minecraft instances and launch
+set(MINECRAFT_SOURCES
# Minecraft support
+ minecraft/auth/AuthSession.h
+ minecraft/auth/AuthSession.cpp
+ minecraft/auth/MojangAccountList.h
+ minecraft/auth/MojangAccountList.cpp
+ minecraft/auth/MojangAccount.h
+ minecraft/auth/MojangAccount.cpp
+ minecraft/auth/YggdrasilTask.h
+ minecraft/auth/YggdrasilTask.cpp
+ minecraft/auth/flows/AuthenticateTask.h
+ minecraft/auth/flows/AuthenticateTask.cpp
+ minecraft/auth/flows/RefreshTask.cpp
+ minecraft/auth/flows/RefreshTask.cpp
+ minecraft/auth/flows/ValidateTask.h
+ minecraft/auth/flows/ValidateTask.cpp
minecraft/onesix/OneSixUpdate.h
minecraft/onesix/OneSixUpdate.cpp
minecraft/onesix/OneSixInstance.h
@@ -201,17 +248,67 @@ set(LOGIC_SOURCES
minecraft/ftb/FTBPlugin.h
minecraft/ftb/FTBPlugin.cpp
- # A Recursive file system watcher
- RecursiveFileSystemWatcher.h
- RecursiveFileSystemWatcher.cpp
+ # Assets
+ minecraft/AssetsUtils.h
+ minecraft/AssetsUtils.cpp
- # the screenshots feature
+ # Forge and all things forge related
+ minecraft/forge/ForgeVersion.h
+ minecraft/forge/ForgeVersion.cpp
+ minecraft/forge/ForgeVersionList.h
+ minecraft/forge/ForgeVersionList.cpp
+ minecraft/forge/ForgeXzDownload.h
+ minecraft/forge/ForgeXzDownload.cpp
+ minecraft/forge/LegacyForge.h
+ minecraft/forge/LegacyForge.cpp
+ minecraft/forge/ForgeInstaller.h
+ minecraft/forge/ForgeInstaller.cpp
+
+ # Liteloader and related things
+ minecraft/liteloader/LiteLoaderInstaller.h
+ minecraft/liteloader/LiteLoaderInstaller.cpp
+ minecraft/liteloader/LiteLoaderVersionList.h
+ minecraft/liteloader/LiteLoaderVersionList.cpp
+)
+
+add_unit_test(GradleSpecifier
+ SOURCES minecraft/GradleSpecifier_test.cpp
+ LIBS MultiMC_logic
+ )
+
+add_unit_test(MojangVersionFormat
+ SOURCES minecraft/MojangVersionFormat_test.cpp
+ LIBS MultiMC_logic
+ DATA minecraft/testdata
+ )
+
+add_unit_test(Library
+ SOURCES minecraft/Library_test.cpp
+ LIBS MultiMC_logic
+ )
+
+# FIXME: shares data with FileSystem test
+add_unit_test(ModList
+ SOURCES minecraft/ModList_test.cpp
+ DATA testdata
+ LIBS MultiMC_logic
+ )
+
+add_unit_test(ParseUtils
+ SOURCES minecraft/ParseUtils_test.cpp
+ LIBS MultiMC_logic
+ )
+
+# the screenshots feature
+set(SCREENSHOTS_SOURCES
screenshots/Screenshot.h
screenshots/ImgurUpload.h
screenshots/ImgurUpload.cpp
screenshots/ImgurAlbumCreation.h
screenshots/ImgurAlbumCreation.cpp
+)
+set(TASKS_SOURCES
# Tasks
tasks/Task.h
tasks/Task.cpp
@@ -219,7 +316,9 @@ set(LOGIC_SOURCES
tasks/ThreadTask.cpp
tasks/SequentialTask.h
tasks/SequentialTask.cpp
+)
+set(SETTINGS_SOURCES
# Settings
settings/INIFile.cpp
settings/INIFile.h
@@ -233,7 +332,14 @@ set(LOGIC_SOURCES
settings/Setting.h
settings/SettingsObject.cpp
settings/SettingsObject.h
+)
+
+add_unit_test(INIFile
+ SOURCES settings/INIFile_test.cpp
+ LIBS MultiMC_logic
+ )
+set(JAVA_SOURCES
# Java related code
java/launch/CheckJava.cpp
java/launch/CheckJava.h
@@ -249,33 +355,20 @@ set(LOGIC_SOURCES
java/JavaUtils.cpp
java/JavaVersion.h
java/JavaVersion.cpp
+)
- # Assets
- minecraft/AssetsUtils.h
- minecraft/AssetsUtils.cpp
-
- # Forge and all things forge related
- minecraft/forge/ForgeVersion.h
- minecraft/forge/ForgeVersion.cpp
- minecraft/forge/ForgeVersionList.h
- minecraft/forge/ForgeVersionList.cpp
- minecraft/forge/ForgeXzDownload.h
- minecraft/forge/ForgeXzDownload.cpp
- minecraft/forge/LegacyForge.h
- minecraft/forge/LegacyForge.cpp
- minecraft/forge/ForgeInstaller.h
- minecraft/forge/ForgeInstaller.cpp
-
- # Liteloader and related things
- minecraft/liteloader/LiteLoaderInstaller.h
- minecraft/liteloader/LiteLoaderInstaller.cpp
- minecraft/liteloader/LiteLoaderVersionList.h
- minecraft/liteloader/LiteLoaderVersionList.cpp
+add_unit_test(JavaVersion
+ SOURCES java/JavaVersion_test.cpp
+ LIBS MultiMC_logic
+ )
+set(TRANSLATIONS_SOURCES
# Translations
trans/TranslationDownloader.h
trans/TranslationDownloader.cpp
+)
+set(TOOLS_SOURCES
# Tools
tools/BaseExternalTool.cpp
tools/BaseExternalTool.h
@@ -287,7 +380,9 @@ set(LOGIC_SOURCES
tools/JVisualVM.h
tools/MCEditTool.cpp
tools/MCEditTool.h
+)
+set(WONKO_SOURCES
# Wonko
wonko/tasks/BaseWonkoEntityRemoteLoadTask.cpp
wonko/tasks/BaseWonkoEntityRemoteLoadTask.h
@@ -310,11 +405,36 @@ set(LOGIC_SOURCES
wonko/WonkoReference.cpp
wonko/WonkoReference.h
)
+
+add_unit_test(WonkoIndex
+ SOURCES wonko/WonkoIndex_test.cpp
+ LIBS MultiMC_logic
+ )
+
################################ COMPILE ################################
# we need zlib
find_package(ZLIB REQUIRED)
+set(LOGIC_SOURCES
+ ${CORE_SOURCES}
+ ${PATHMATCHER_SOURCES}
+ ${NET_SOURCES}
+ ${LAUNCH_SOURCES}
+ ${UPDATE_SOURCES}
+ ${NOTIFICATIONS_SOURCES}
+ ${NEWS_SOURCES}
+ ${STATUS_SOURCES}
+ ${MINECRAFT_SOURCES}
+ ${SCREENSHOTS_SOURCES}
+ ${TASKS_SOURCES}
+ ${SETTINGS_SOURCES}
+ ${JAVA_SOURCES}
+ ${TRANSLATIONS_SOURCES}
+ ${TOOLS_SOURCES}
+ ${WONKO_SOURCES}
+)
+
add_library(MultiMC_logic SHARED ${LOGIC_SOURCES})
set_target_properties(MultiMC_logic PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1)
diff --git a/tests/tst_FileSystem.cpp b/api/logic/FileSystem_test.cpp
index ae1f93bb..d5e1eedb 100644
--- a/tests/tst_FileSystem.cpp
+++ b/api/logic/FileSystem_test.cpp
@@ -1,5 +1,6 @@
#include <QTest>
#include <QTemporaryDir>
+#include <QStandardPaths>
#include "TestUtil.h"
#include "FileSystem.h"
@@ -80,7 +81,7 @@ slots:
void test_copy()
{
- QString folder = QFINDTESTDATA("tests/data/test_folder");
+ QString folder = QFINDTESTDATA("data/test_folder");
auto f = [&folder]()
{
QTemporaryDir tempDir;
@@ -110,8 +111,54 @@ slots:
QVERIFY(folder.endsWith('/'));
f();
}
+
+ void test_getDesktop()
+ {
+ QCOMPARE(FS::getDesktopDir(), QStandardPaths::writableLocation(QStandardPaths::DesktopLocation));
+ }
+
+// this is only valid on linux
+// FIXME: implement on windows, OSX, then test.
+#if defined(Q_OS_LINUX)
+ void test_createShortcut_data()
+ {
+ QTest::addColumn<QString>("location");
+ QTest::addColumn<QString>("dest");
+ QTest::addColumn<QStringList>("args");
+ QTest::addColumn<QString>("name");
+ QTest::addColumn<QString>("iconLocation");
+ QTest::addColumn<QByteArray>("result");
+
+ QTest::newRow("unix") << QDir::currentPath()
+ << "asdfDest"
+ << (QStringList() << "arg1" << "arg2")
+ << "asdf"
+ << QString()
+ #if defined(Q_OS_LINUX)
+ << MULTIMC_GET_TEST_FILE("data/FileSystem-test_createShortcut-unix")
+ #elif defined(Q_OS_WIN)
+ << QByteArray()
+ #endif
+ ;
+ }
+
+ void test_createShortcut()
+ {
+ QFETCH(QString, location);
+ QFETCH(QString, dest);
+ QFETCH(QStringList, args);
+ QFETCH(QString, name);
+ QFETCH(QString, iconLocation);
+ QFETCH(QByteArray, result);
+
+ QVERIFY(FS::createShortCut(location, dest, args, name, iconLocation));
+ QCOMPARE(QString::fromLocal8Bit(TestsInternal::readFile(location + QDir::separator() + name + ".desktop")), QString::fromLocal8Bit(result));
+
+ //QDir().remove(location);
+ }
+#endif
};
QTEST_GUILESS_MAIN(FileSystemTest)
-#include "tst_FileSystem.moc"
+#include "FileSystem_test.moc"
diff --git a/tests/tst_GZip.cpp b/api/logic/GZip_test.cpp
index 67707a4b..f4c9214c 100644
--- a/tests/tst_GZip.cpp
+++ b/api/logic/GZip_test.cpp
@@ -54,4 +54,4 @@ slots:
QTEST_GUILESS_MAIN(GZipTest)
-#include "tst_GZip.moc"
+#include "GZip_test.moc"
diff --git a/tests/tst_modutils.cpp b/api/logic/Version_test.cpp
index 1894711e..4c083934 100644
--- a/tests/tst_modutils.cpp
+++ b/api/logic/Version_test.cpp
@@ -120,4 +120,4 @@ private slots:
QTEST_GUILESS_MAIN(ModUtilsTest)
-#include "tst_modutils.moc"
+#include "Version_test.moc"
diff --git a/tests/tst_JavaVersion.cpp b/api/logic/java/JavaVersion_test.cpp
index 708c8d8d..9dae0ba6 100644
--- a/tests/tst_JavaVersion.cpp
+++ b/api/logic/java/JavaVersion_test.cpp
@@ -113,8 +113,4 @@ slots:
QTEST_GUILESS_MAIN(JavaVersionTest)
-#include "tst_JavaVersion.moc"
-
-
- // manual testing fakery
-
+#include "JavaVersion_test.moc"
diff --git a/tests/tst_gradlespecifier.cpp b/api/logic/minecraft/GradleSpecifier_test.cpp
index 146c9838..155522cd 100644
--- a/tests/tst_gradlespecifier.cpp
+++ b/api/logic/minecraft/GradleSpecifier_test.cpp
@@ -74,4 +74,4 @@ slots:
QTEST_GUILESS_MAIN(GradleSpecifierTest)
-#include "tst_gradlespecifier.moc"
+#include "GradleSpecifier_test.moc"
diff --git a/tests/tst_Library.cpp b/api/logic/minecraft/Library_test.cpp
index b5840261..fcf0b4d1 100644
--- a/tests/tst_Library.cpp
+++ b/api/logic/minecraft/Library_test.cpp
@@ -192,4 +192,4 @@ private:
QTEST_GUILESS_MAIN(LibraryTest)
-#include "tst_Library.moc"
+#include "Library_test.moc"
diff --git a/tests/tst_ModList.cpp b/api/logic/minecraft/ModList_test.cpp
index e3aa1435..155c238a 100644
--- a/tests/tst_ModList.cpp
+++ b/api/logic/minecraft/ModList_test.cpp
@@ -16,7 +16,7 @@ slots:
void test_1178()
{
// source
- QString source = QFINDTESTDATA("tests/data/test_folder");
+ QString source = QFINDTESTDATA("data/test_folder");
// sanity check
QVERIFY(!source.endsWith('/'));
@@ -50,4 +50,4 @@ slots:
QTEST_GUILESS_MAIN(ModListTest)
-#include "tst_ModList.moc"
+#include "ModList_test.moc"
diff --git a/tests/tst_MojangVersionFormat.cpp b/api/logic/minecraft/MojangVersionFormat_test.cpp
index 2e7b1cb8..5b836271 100644
--- a/tests/tst_MojangVersionFormat.cpp
+++ b/api/logic/minecraft/MojangVersionFormat_test.cpp
@@ -31,7 +31,7 @@ slots:
void test_Through_Simple()
{
- QJsonDocument doc = readJson("tests/data/1.9-simple.json");
+ QJsonDocument doc = readJson("data/1.9-simple.json");
auto vfile = MojangVersionFormat::versionFileFromJson(doc, "1.9-simple.json");
auto doc2 = MojangVersionFormat::versionFileToJson(vfile);
writeJson("1.9-simple-passthorugh.json", doc2);
@@ -41,7 +41,7 @@ slots:
void test_Through()
{
- QJsonDocument doc = readJson("tests/data/1.9.json");
+ QJsonDocument doc = readJson("data/1.9.json");
auto vfile = MojangVersionFormat::versionFileFromJson(doc, "1.9.json");
auto doc2 = MojangVersionFormat::versionFileToJson(vfile);
writeJson("1.9-passthorugh.json", doc2);
@@ -51,5 +51,5 @@ slots:
QTEST_GUILESS_MAIN(MojangVersionFormatTest)
-#include "tst_MojangVersionFormat.moc"
+#include "MojangVersionFormat_test.moc"
diff --git a/tests/tst_ParseUtils.cpp b/api/logic/minecraft/ParseUtils_test.cpp
index d961e52b..79bed1d4 100644
--- a/tests/tst_ParseUtils.cpp
+++ b/api/logic/minecraft/ParseUtils_test.cpp
@@ -41,5 +41,5 @@ slots:
QTEST_GUILESS_MAIN(ParseUtilsTest)
-#include "tst_ParseUtils.moc"
+#include "ParseUtils_test.moc"
diff --git a/tests/data/1.9-simple.json b/api/logic/minecraft/testdata/1.9-simple.json
index 574c5b06..574c5b06 100644
--- a/tests/data/1.9-simple.json
+++ b/api/logic/minecraft/testdata/1.9-simple.json
diff --git a/tests/data/1.9.json b/api/logic/minecraft/testdata/1.9.json
index 697c6059..697c6059 100644
--- a/tests/data/1.9.json
+++ b/api/logic/minecraft/testdata/1.9.json
diff --git a/tests/data/lib-native-arch.json b/api/logic/minecraft/testdata/lib-native-arch.json
index a73aac54..a73aac54 100644
--- a/tests/data/lib-native-arch.json
+++ b/api/logic/minecraft/testdata/lib-native-arch.json
diff --git a/tests/data/lib-native.json b/api/logic/minecraft/testdata/lib-native.json
index 0a95b2b9..0a95b2b9 100644
--- a/tests/data/lib-native.json
+++ b/api/logic/minecraft/testdata/lib-native.json
diff --git a/tests/data/lib-simple.json b/api/logic/minecraft/testdata/lib-simple.json
index 3ef0f490..3ef0f490 100644
--- a/tests/data/lib-simple.json
+++ b/api/logic/minecraft/testdata/lib-simple.json
diff --git a/tests/tst_inifile.cpp b/api/logic/settings/INIFile_test.cpp
index 2c3d8103..b3ae7375 100644
--- a/tests/tst_inifile.cpp
+++ b/api/logic/settings/INIFile_test.cpp
@@ -59,4 +59,4 @@ slots:
QTEST_GUILESS_MAIN(IniFileTest)
-#include "tst_inifile.moc"
+#include "INIFile_test.moc"
diff --git a/tests/data/tst_userutils-test_createShortcut-unix b/api/logic/testdata/FileSystem-test_createShortcut-unix
index 1ce3a2bd..1ce3a2bd 100755
--- a/tests/data/tst_userutils-test_createShortcut-unix
+++ b/api/logic/testdata/FileSystem-test_createShortcut-unix
diff --git a/tests/data_raw/test_folder/assets/minecraft/textures/blah.txt b/api/logic/testdata/test_folder/assets/minecraft/textures/blah.txt
index 8d1c8b69..8d1c8b69 100644
--- a/tests/data_raw/test_folder/assets/minecraft/textures/blah.txt
+++ b/api/logic/testdata/test_folder/assets/minecraft/textures/blah.txt
diff --git a/tests/data_raw/test_folder/pack.mcmeta b/api/logic/testdata/test_folder/pack.mcmeta
index 67ee0434..67ee0434 100644
--- a/tests/data_raw/test_folder/pack.mcmeta
+++ b/api/logic/testdata/test_folder/pack.mcmeta
diff --git a/tests/data_raw/test_folder/pack.nfo b/api/logic/testdata/test_folder/pack.nfo
index 8d1c8b69..8d1c8b69 100644
--- a/tests/data_raw/test_folder/pack.nfo
+++ b/api/logic/testdata/test_folder/pack.nfo
diff --git a/tests/tst_DownloadTask.cpp b/api/logic/updater/DownloadTask_test.cpp
index 743bf514..edf0f507 100644
--- a/tests/tst_DownloadTask.cpp
+++ b/api/logic/updater/DownloadTask_test.cpp
@@ -77,31 +77,31 @@ slots:
QTest::addColumn<bool>("ret");
QTest::newRow("one")
- << MULTIMC_GET_TEST_FILE("tests/data/1.json")
+ << MULTIMC_GET_TEST_FILE("data/1.json")
<< (VersionFileList()
<< VersionFileEntry{"fileOne",
493,
- encodeBaseFile("/tests/data/fileOneA"),
+ encodeBaseFile("/data/fileOneA"),
"9eb84090956c484e32cb6c08455a667b"}
<< VersionFileEntry{"fileTwo",
644,
- encodeBaseFile("/tests/data/fileTwo"),
+ encodeBaseFile("/data/fileTwo"),
"38f94f54fa3eb72b0ea836538c10b043"}
<< VersionFileEntry{"fileThree",
750,
- encodeBaseFile("/tests/data/fileThree"),
+ encodeBaseFile("/data/fileThree"),
"f12df554b21e320be6471d7154130e70"})
<< QString() << true;
QTest::newRow("two")
- << MULTIMC_GET_TEST_FILE("tests/data/2.json")