1
1
project (MultiMC_logic)
2
2
3
- set (LOGIC_SOURCES
3
+ include (UnitTest)
4
+
5
+ set (CORE_SOURCES
4
6
# LOGIC - Base classes and infrastructure
5
7
BaseInstaller.h
6
8
BaseInstaller.cpp
@@ -42,12 +44,6 @@ set(LOGIC_SOURCES
42
44
# a smart pointer wrapper intended for safer use with Qt signal/slot mechanisms
43
45
QObjectPtr.h
44
46
45
- # Path matchers
46
- pathmatcher/FSTreeMatcher.h
47
- pathmatcher/IPathMatcher.h
48
- pathmatcher/MultiMatcher.h
49
- pathmatcher/RegexpMatcher.h
50
-
51
47
# Compression support
52
48
GZip.h
53
49
GZip.cpp
@@ -60,6 +56,31 @@ set(LOGIC_SOURCES
60
56
Version .h
61
57
Version .cpp
62
58
59
+ # A Recursive file system watcher
60
+ RecursiveFileSystemWatcher.h
61
+ RecursiveFileSystemWatcher.cpp
62
+ )
63
+
64
+ add_unit_test(FileSystem
65
+ SOURCES FileSystem_test.cpp
66
+ LIBS MultiMC_logic
67
+ DATA testdata
68
+ )
69
+
70
+ add_unit_test(GZip
71
+ SOURCES GZip_test.cpp
72
+ LIBS MultiMC_logic
73
+ )
74
+
75
+ set (PATHMATCHER_SOURCES
76
+ # Path matchers
77
+ pathmatcher/FSTreeMatcher.h
78
+ pathmatcher/IPathMatcher.h
79
+ pathmatcher/MultiMatcher.h
80
+ pathmatcher/RegexpMatcher.h
81
+ )
82
+
83
+ set (NET_SOURCES
63
84
# network stuffs
64
85
net/NetAction.h
65
86
net/MD5EtagDownload.h
@@ -76,24 +97,10 @@ set(LOGIC_SOURCES
76
97
net/PasteUpload.cpp
77
98
net/URLConstants.h
78
99
net/URLConstants.cpp
100
+ )
79
101
80
- # Yggdrasil login stuff
81
- minecraft/auth/AuthSession.h
82
- minecraft/auth/AuthSession.cpp
83
- minecraft/auth/MojangAccountList.h
84
- minecraft/auth/MojangAccountList.cpp
85
- minecraft/auth/MojangAccount.h
86
- minecraft/auth/MojangAccount.cpp
87
- minecraft/auth/YggdrasilTask.h
88
- minecraft/auth/YggdrasilTask.cpp
89
- minecraft/auth/flows/AuthenticateTask.h
90
- minecraft/auth/flows/AuthenticateTask.cpp
91
- minecraft/auth/flows/RefreshTask.cpp
92
- minecraft/auth/flows/RefreshTask.cpp
93
- minecraft/auth/flows/ValidateTask.h
94
- minecraft/auth/flows/ValidateTask.cpp
95
-
96
- # Game launch logic
102
+ # Game launch logic
103
+ set (LAUNCH_SOURCES
97
104
launch/steps/PostLaunchCommand.cpp
98
105
launch/steps/PostLaunchCommand.h
99
106
launch/steps/PreLaunchCommand.cpp
@@ -110,30 +117,70 @@ set(LOGIC_SOURCES
110
117
launch/LoggedProcess.h
111
118
launch/MessageLevel.cpp
112
119
launch/MessageLevel.h
120
+ )
113
121
114
- # Update system
122
+ # Old update system
123
+ set (UPDATE_SOURCES
115
124
updater/GoUpdate.h
116
125
updater/GoUpdate.cpp
117
126
updater/UpdateChecker.h
118
127
updater/UpdateChecker.cpp
119
128
updater/DownloadTask.h
120
129
updater/DownloadTask.cpp
130
+ )
131
+
132
+ add_unit_test(UpdateChecker
133
+ SOURCES updater/UpdateChecker_test.cpp
134
+ LIBS MultiMC_logic
135
+ DATA updater/testdata
136
+ )
137
+
138
+ add_unit_test(DownloadTask
139
+ SOURCES updater/DownloadTask_test.cpp
140
+ LIBS MultiMC_logic
141
+ DATA updater/testdata
142
+ )
121
143
144
+ # Rarely used notifications
145
+ set (NOTIFICATIONS_SOURCES
122
146
# Notifications - short warning messages
123
147
notifications/NotificationChecker.h
124
148
notifications/NotificationChecker.cpp
149
+ )
125
150
151
+ # Backend for the news bar... there's usually no news.
152
+ set (NEWS_SOURCES
126
153
# News System
127
154
news/NewsChecker.h
128
155
news/NewsChecker.cpp
129
156
news/NewsEntry.h
130
157
news/NewsEntry.cpp
158
+ )
131
159
160
+ # Minecraft services status checker
161
+ set (STATUS_SOURCES
132
162
# Status system
133
163
status /StatusChecker.h
134
164
status /StatusChecker.cpp
165
+ )
135
166
167
+ # Support for Minecraft instances and launch
168
+ set (MINECRAFT_SOURCES
136
169
# Minecraft support
170
+ minecraft/auth/AuthSession.h
171
+ minecraft/auth/AuthSession.cpp
172
+ minecraft/auth/MojangAccountList.h
173
+ minecraft/auth/MojangAccountList.cpp
174
+ minecraft/auth/MojangAccount.h
175
+ minecraft/auth/MojangAccount.cpp
176
+ minecraft/auth/YggdrasilTask.h
177
+ minecraft/auth/YggdrasilTask.cpp
178
+ minecraft/auth/flows/AuthenticateTask.h
179
+ minecraft/auth/flows/AuthenticateTask.cpp
180
+ minecraft/auth/flows/RefreshTask.cpp
181
+ minecraft/auth/flows/RefreshTask.cpp
182
+ minecraft/auth/flows/ValidateTask.h
183
+ minecraft/auth/flows/ValidateTask.cpp
137
184
minecraft/onesix/OneSixUpdate.h
138
185
minecraft/onesix/OneSixUpdate.cpp
139
186
minecraft/onesix/OneSixInstance.h
@@ -201,25 +248,77 @@ set(LOGIC_SOURCES
201
248
minecraft/ftb/FTBPlugin.h
202
249
minecraft/ftb/FTBPlugin.cpp
203
250
204
- # A Recursive file system watcher
205
- RecursiveFileSystemWatcher .h
206
- RecursiveFileSystemWatcher .cpp
251
+ # Assets
252
+ minecraft/AssetsUtils .h
253
+ minecraft/AssetsUtils .cpp
207
254
208
- # the screenshots feature
255
+ # Forge and all things forge related
256
+ minecraft/forge/ForgeVersion.h
257
+ minecraft/forge/ForgeVersion.cpp
258
+ minecraft/forge/ForgeVersionList.h
259
+ minecraft/forge/ForgeVersionList.cpp
260
+ minecraft/forge/ForgeXzDownload.h
261
+ minecraft/forge/ForgeXzDownload.cpp
262
+ minecraft/forge/LegacyForge.h
263
+ minecraft/forge/LegacyForge.cpp
264
+ minecraft/forge/ForgeInstaller.h
265
+ minecraft/forge/ForgeInstaller.cpp
266
+
267
+ # Liteloader and related things
268
+ minecraft/liteloader/LiteLoaderInstaller.h
269
+ minecraft/liteloader/LiteLoaderInstaller.cpp
270
+ minecraft/liteloader/LiteLoaderVersionList.h
271
+ minecraft/liteloader/LiteLoaderVersionList.cpp
272
+ )
273
+
274
+ add_unit_test(GradleSpecifier
275
+ SOURCES minecraft/GradleSpecifier_test.cpp
276
+ LIBS MultiMC_logic
277
+ )
278
+
279
+ add_unit_test(MojangVersionFormat
280
+ SOURCES minecraft/MojangVersionFormat_test.cpp
281
+ LIBS MultiMC_logic
282
+ DATA minecraft/testdata
283
+ )
284
+
285
+ add_unit_test(Library
286
+ SOURCES minecraft/Library_test.cpp
287
+ LIBS MultiMC_logic
288
+ )
289
+
290
+ # FIXME: shares data with FileSystem test
291
+ add_unit_test(ModList
292
+ SOURCES minecraft/ModList_test.cpp
293
+ DATA testdata
294
+ LIBS MultiMC_logic
295
+ )
296
+
297
+ add_unit_test(ParseUtils
298
+ SOURCES minecraft/ParseUtils_test.cpp
299
+ LIBS MultiMC_logic
300
+ )
301
+
302
+ # the screenshots feature
303
+ set (SCREENSHOTS_SOURCES
209
304
screenshots/Screenshot.h
210
305
screenshots/ImgurUpload.h
211
306
screenshots/ImgurUpload.cpp
212
307
screenshots/ImgurAlbumCreation.h
213
308
screenshots/ImgurAlbumCreation.cpp
309
+ )
214
310
311
+ set (TASKS_SOURCES
215
312
# Tasks
216
313
tasks/Task.h
217
314
tasks/Task.cpp
218
315
tasks/ThreadTask.h
219
316
tasks/ThreadTask.cpp
220
317
tasks/SequentialTask.h
221
318
tasks/SequentialTask.cpp
319
+ )
222
320
321
+ set (SETTINGS_SOURCES
223
322
# Settings
224
323
settings/INIFile.cpp
225
324
settings/INIFile.h
@@ -233,7 +332,14 @@ set(LOGIC_SOURCES
233
332
settings/Setting.h
234
333
settings/SettingsObject.cpp
235
334
settings/SettingsObject.h
335
+ )
336
+
337
+ add_unit_test(INIFile
338
+ SOURCES settings/INIFile_test.cpp
339
+ LIBS MultiMC_logic
340
+ )
236
341
342
+ set (JAVA_SOURCES
237
343
# Java related code
238
344
java/launch/CheckJava.cpp
239
345
java/launch/CheckJava.h
@@ -249,33 +355,20 @@ set(LOGIC_SOURCES
249
355
java/JavaUtils.cpp
250
356
java/JavaVersion.h
251
357
java/JavaVersion.cpp
358
+ )
252
359
253
- # Assets
254
- minecraft/AssetsUtils.h
255
- minecraft/AssetsUtils.cpp
256
-
257
- # Forge and all things forge related
258
- minecraft/forge/ForgeVersion.h
259
- minecraft/forge/ForgeVersion.cpp
260
- minecraft/forge/ForgeVersionList.h
261
- minecraft/forge/ForgeVersionList.cpp
262
- minecraft/forge/ForgeXzDownload.h
263
- minecraft/forge/ForgeXzDownload.cpp
264
- minecraft/forge/LegacyForge.h
265
- minecraft/forge/LegacyForge.cpp
266
- minecraft/forge/ForgeInstaller.h
267
- minecraft/forge/ForgeInstaller.cpp
268
-
269
- # Liteloader and related things
270
- minecraft/liteloader/LiteLoaderInstaller.h
271
- minecraft/liteloader/LiteLoaderInstaller.cpp
272
- minecraft/liteloader/LiteLoaderVersionList.h
273
- minecraft/liteloader/LiteLoaderVersionList.cpp
360
+ add_unit_test(JavaVersion
361
+ SOURCES java/JavaVersion_test.cpp
362
+ LIBS MultiMC_logic
363
+ )
274
364
365
+ set (TRANSLATIONS_SOURCES
275
366
# Translations
276
367
trans/TranslationDownloader.h
277
368
trans/TranslationDownloader.cpp
369
+ )
278
370
371
+ set (TOOLS_SOURCES
279
372
# Tools
280
373
tools/BaseExternalTool.cpp
281
374
tools/BaseExternalTool.h
@@ -287,7 +380,9 @@ set(LOGIC_SOURCES
287
380
tools/JVisualVM.h
288
381
tools/MCEditTool.cpp
289
382
tools/MCEditTool.h
383
+ )
290
384
385
+ set (WONKO_SOURCES
291
386
# Wonko
292
387
wonko/tasks/BaseWonkoEntityRemoteLoadTask.cpp
293
388
wonko/tasks/BaseWonkoEntityRemoteLoadTask.h
@@ -310,11 +405,36 @@ set(LOGIC_SOURCES
310
405
wonko/WonkoReference.cpp
311
406
wonko/WonkoReference.h
312
407
)
408
+
409
+ add_unit_test(WonkoIndex
410
+ SOURCES wonko/WonkoIndex_test.cpp
411
+ LIBS MultiMC_logic
412
+ )
413
+
313
414
################################ COMPILE ################################
314
415
315
416
# we need zlib
316
417
find_package (ZLIB REQUIRED)
317
418
419
+ set (LOGIC_SOURCES
420
+ ${CORE_SOURCES}
421
+ ${PATHMATCHER_SOURCES}
422
+ ${NET_SOURCES}
423
+ ${LAUNCH_SOURCES}
424
+ ${UPDATE_SOURCES}
425
+ ${NOTIFICATIONS_SOURCES}
426
+ ${NEWS_SOURCES}
427
+ ${STATUS_SOURCES}
428
+ ${MINECRAFT_SOURCES}
429
+ ${SCREENSHOTS_SOURCES}
430
+ ${TASKS_SOURCES}
431
+ ${SETTINGS_SOURCES}
432
+ ${JAVA_SOURCES}
433
+ ${TRANSLATIONS_SOURCES}
434
+ ${TOOLS_SOURCES}
435
+ ${WONKO_SOURCES}
436
+ )
437
+
318
438
add_library (MultiMC_logic SHARED ${LOGIC_SOURCES} )
319
439
set_target_properties (MultiMC_logic PROPERTIES CXX_VISIBILITY_PRESET hidden VISIBILITY_INLINES_HIDDEN 1)
320
440
0 commit comments