Use std::queue for HTTPFetchRequest and std::vector for log_output instead of std...
[oweals/minetest.git] / src / main.cpp
index 092fa9e1797ae58f895c21acb9bb24e08a2f9c2f..922effb1f38af57b2a87dc3e80553c275723d6b8 100644 (file)
@@ -17,19 +17,6 @@ with this program; if not, write to the Free Software Foundation, Inc.,
 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */
 
-#ifdef NDEBUG
-       /*#ifdef _WIN32
-               #pragma message ("Disabling unit tests")
-       #else
-               #warning "Disabling unit tests"
-       #endif*/
-       // Disable unit tests
-       #define ENABLE_TESTS 0
-#else
-       // Enable unit tests
-       #define ENABLE_TESTS 1
-#endif
-
 #ifdef _MSC_VER
 #ifndef SERVER // Dedicated server isn't linked with Irrlicht
        #pragma comment(lib, "Irrlicht.lib")
@@ -279,9 +266,9 @@ int main(int argc, char *argv[])
 
 #ifndef __ANDROID__
        // Run unit tests
-       if ((ENABLE_TESTS && cmd_args.getFlag("disable-unittests") == false)
-                       || cmd_args.getFlag("enable-unittests") == true) {
+       if (cmd_args.getFlag("run-unittests")) {
                run_tests();
+               return 0;
        }
 #endif
 
@@ -352,10 +339,8 @@ static void set_allowed_options(OptionList *allowed_options)
                        _("Load configuration from specified file"))));
        allowed_options->insert(std::make_pair("port", ValueSpec(VALUETYPE_STRING,
                        _("Set network port (UDP)"))));
-       allowed_options->insert(std::make_pair("disable-unittests", ValueSpec(VALUETYPE_FLAG,
-                       _("Disable unit tests"))));
-       allowed_options->insert(std::make_pair("enable-unittests", ValueSpec(VALUETYPE_FLAG,
-                       _("Enable unit tests"))));
+       allowed_options->insert(std::make_pair("run-unittests", ValueSpec(VALUETYPE_FLAG,
+                       _("Run the unit tests and exit"))));
        allowed_options->insert(std::make_pair("map-dir", ValueSpec(VALUETYPE_STRING,
                        _("Same as --world (deprecated)"))));
        allowed_options->insert(std::make_pair("world", ValueSpec(VALUETYPE_STRING,