Daniele Bartolini 9 лет назад
Родитель
Сommit
0713bf1525
4 измененных файлов с 6 добавлено и 6 удалено
  1. 3 1
      src/core/unit_tests.cpp
  2. 1 1
      src/core/unit_tests.h
  3. 1 2
      src/device/main_linux.cpp
  4. 1 2
      src/device/main_windows.cpp

+ 3 - 1
src/core/unit_tests.cpp

@@ -1259,7 +1259,7 @@ static void test_command_line()
 	ENSURE(orange != NULL && strcmp(orange, "orange") == 0);
 }
 
-void run_unit_tests()
+int main_unit_tests()
 {
 	test_memory();
 	test_array();
@@ -1282,6 +1282,8 @@ void run_unit_tests()
 	test_sjson();
 	test_path();
 	test_command_line();
+
+	return EXIT_SUCCESS;
 }
 
 } // namespace crown

+ 1 - 1
src/core/unit_tests.h

@@ -8,6 +8,6 @@
 namespace crown
 {
 	/// Runs all the unit tests.
-	void run_unit_tests();
+	int main_unit_tests();
 
 } // namespace crown

+ 1 - 2
src/device/main_linux.cpp

@@ -749,8 +749,7 @@ int main(int argc, char** argv)
 	CommandLine cl(argc, (const char**)argv);
 	if (cl.has_argument("run-unit-tests"))
 	{
-		run_unit_tests();
-		return EXIT_SUCCESS;
+		return main_unit_tests();
 	}
 #endif // CROWN_BUILD_UNIT_TESTS
 	if (cl.has_argument("compile") || cl.has_argument("server"))

+ 1 - 2
src/device/main_windows.cpp

@@ -718,8 +718,7 @@ int main(int argc, char** argv)
 	CommandLine cl(argc, (const char**)argv);
 	if (cl.has_argument("run-unit-tests"))
 	{
-		run_unit_tests();
-		return EXIT_SUCCESS;
+		return run_unit_tests();
 	}
 #endif // CROWN_BUILD_UNIT_TESTS
 	if (cl.has_argument("compile") || cl.has_argument("server"))