Main.cpp 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  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 <AzTest/AzTest.h>
  9. #include <AzCore/Memory/SystemAllocator.h>
  10. #include <AzQtComponents/Utilities/QtPluginPaths.h>
  11. #include <QApplication>
  12. namespace UnitTest
  13. {
  14. // Handle asserts
  15. class ToolsFrameworkHook
  16. : public AZ::Test::ITestEnvironment
  17. {
  18. public:
  19. void SetupEnvironment() override
  20. {
  21. }
  22. void TeardownEnvironment() override
  23. {
  24. }
  25. };
  26. } // namespace UnitTest
  27. AZTEST_EXPORT int AZ_UNIT_TEST_HOOK_NAME(int argc, char** argv)
  28. {
  29. ::testing::InitGoogleMock(&argc, argv);
  30. AzQtComponents::PrepareQtPaths();
  31. QApplication app(argc, argv);
  32. AZ::Test::printUnusedParametersWarning(argc, argv);
  33. AZ::Test::addTestEnvironments({ new UnitTest::ToolsFrameworkHook });
  34. int result = RUN_ALL_TESTS();
  35. return result;
  36. }
  37. IMPLEMENT_TEST_EXECUTABLE_MAIN();