main_batch.cpp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) Contributors to the Open 3D Engine Project.
  3. * For complete copyright and license terms please see the LICENSE at the root of this distribution.
  4. *
  5. * SPDX-License-Identifier: Apache-2.0 OR MIT
  6. *
  7. */
  8. #include "utilities/BatchApplicationManager.h"
  9. int main(int argc, char* argv[])
  10. {
  11. const AZ::Debug::Trace tracer;
  12. qputenv("QT_MAC_DISABLE_FOREGROUND_APPLICATION_TRANSFORM", "1");
  13. BatchApplicationManager applicationManager(&argc, &argv);
  14. setvbuf(stdout, NULL, _IONBF, 0); // Disabling output buffering to fix test failures due to incomplete logs
  15. ApplicationManager::BeforeRunStatus status = applicationManager.BeforeRun();
  16. if (status != ApplicationManager::BeforeRunStatus::Status_Success)
  17. {
  18. if (status == ApplicationManager::BeforeRunStatus::Status_Restarting)
  19. {
  20. //AssetProcessor will restart
  21. return 0;
  22. }
  23. else
  24. {
  25. //Initialization failed
  26. return 1;
  27. }
  28. }
  29. return applicationManager.Run() ? 0 : 1;
  30. }