test_Main.cpp 947 B

1234567891011121314151617181920212223242526272829303132333435
  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 "EditorDefs.h"
  9. #include <AzTest/AzTest.h>
  10. #include <AzCore/Memory/SystemAllocator.h>
  11. #include <AzCore/UnitTest/UnitTest.h>
  12. #include <QApplication>
  13. class EditorLibTestEnvironment
  14. : public ::UnitTest::TraceBusHook
  15. {
  16. };
  17. AZTEST_EXPORT int AZ_UNIT_TEST_HOOK_NAME(int argc, char** argv)
  18. {
  19. ::testing::InitGoogleMock(&argc, argv);
  20. // NOTE - this line makes this code different from AZ_UNIT_TEST_HOOK()
  21. QApplication app(argc, argv);
  22. // end
  23. AZ::Test::ApplyGlobalParameters(&argc, argv);
  24. AZ::Test::printUnusedParametersWarning(argc, argv);
  25. AZ::Test::addTestEnvironments({new EditorLibTestEnvironment});
  26. int result = RUN_ALL_TESTS();
  27. return result;
  28. }
  29. IMPLEMENT_TEST_EXECUTABLE_MAIN()