AssetScannerTests.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 <native/tests/AssetProcessorTest.h>
  9. #include <QTemporaryDir>
  10. #include <QCoreApplication>
  11. #include <native/utilities/PlatformConfiguration.h>
  12. #include <QSet>
  13. #include <QString>
  14. namespace AssetProcessor
  15. {
  16. class AssetScanner_Test;
  17. class AssetScannerTest
  18. : public AssetProcessor::AssetProcessorTest
  19. {
  20. public:
  21. AssetScannerTest();
  22. // Blocks and runs the QT event pump for up to millisecondsMax and will break out as soon as the scan completes.
  23. bool BlockUntilScanComplete(int millisecondsMax);
  24. protected:
  25. void SetUp() override;
  26. void TearDown() override;
  27. int m_argc;
  28. char** m_argv;
  29. QTemporaryDir m_tempDir;
  30. AZStd::unique_ptr<PlatformConfiguration> m_platformConfig;
  31. AZStd::unique_ptr<AssetScanner_Test> m_assetScanner;
  32. QSet<QString> m_files;
  33. QSet<QString> m_folders;
  34. bool m_scanComplete = false;
  35. AZStd::unique_ptr<QCoreApplication> m_qApp;
  36. };
  37. }