File tree 4 files changed +7
-13
lines changed
4 files changed +7
-13
lines changed Original file line number Diff line number Diff line change @@ -183,8 +183,7 @@ int main(int argc, char *argv[])
183
183
#ifndef __ANDROID__
184
184
// Run unit tests
185
185
if (cmd_args.getFlag (" run-unittests" )) {
186
- run_tests ();
187
- return 0 ;
186
+ return run_tests ();
188
187
}
189
188
#endif
190
189
Original file line number Diff line number Diff line change @@ -244,17 +244,14 @@ void* AsyncWorkerThread::run()
244
244
245
245
std::string script = getServer ()->getBuiltinLuaPath () + DIR_DELIM + " init.lua" ;
246
246
if (!loadScript (script)) {
247
- errorstream << " execution of async base environment failed!"
248
- << std::endl;
249
- abort ();
247
+ FATAL_ERROR (" execution of async base environment failed!" );
250
248
}
251
249
252
250
int error_handler = PUSH_ERROR_HANDLER (L);
253
251
254
252
lua_getglobal (L, " core" );
255
253
if (lua_isnil (L, -1 )) {
256
- errorstream << " Unable to find core within async environment!" ;
257
- abort ();
254
+ FATAL_ERROR (" Unable to find core within async environment!" );
258
255
}
259
256
260
257
// Main loop
@@ -268,8 +265,7 @@ void* AsyncWorkerThread::run()
268
265
269
266
lua_getfield (L, -1 , " job_processor" );
270
267
if (lua_isnil (L, -1 )) {
271
- errorstream << " Unable to get async job processor!" << std::endl;
272
- abort ();
268
+ FATAL_ERROR (" Unable to get async job processor!" );
273
269
}
274
270
275
271
luaL_checktype (L, -1 , LUA_TFUNCTION);
Original file line number Diff line number Diff line change @@ -215,7 +215,7 @@ void TestGameDef::defineSomeNodes()
215
215
// // run_tests
216
216
// //
217
217
218
- void run_tests ()
218
+ bool run_tests ()
219
219
{
220
220
DSTACK (FUNCTION_NAME);
221
221
@@ -253,8 +253,7 @@ void run_tests()
253
253
<< " ++++++++++++++++++++++++++++++++++++++++"
254
254
<< " ++++++++++++++++++++++++++++++++++++++++" << std::endl;
255
255
256
- if (num_modules_failed)
257
- abort ();
256
+ return num_modules_failed;
258
257
}
259
258
260
259
// //
Original file line number Diff line number Diff line change @@ -142,6 +142,6 @@ extern content_t t_CONTENT_WATER;
142
142
extern content_t t_CONTENT_LAVA;
143
143
extern content_t t_CONTENT_BRICK;
144
144
145
- void run_tests ();
145
+ bool run_tests ();
146
146
147
147
#endif
You can’t perform that action at this time.
0 commit comments