AssetProcessorManagerUnitTests.h 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. #pragma once
  9. #if !defined(Q_MOC_RUN)
  10. #include <native/FileWatcher/FileWatcher.h>
  11. #include <native/unittests/UnitTestUtils.h>
  12. #include <native/unittests/AssetProcessorUnitTests.h>
  13. #include <native/tests/UnitTestUtilities.h>
  14. #include <native/utilities/AssetUtilEBusHelper.h>
  15. #include <native/utilities/UuidManager.h>
  16. #include <AzToolsFramework/Metadata/MetadataManager.h>
  17. #endif
  18. namespace AssetProcessor
  19. {
  20. class AssetProcessorManagerUnit_Test;
  21. class AssetProcessorManagerUnitTests
  22. : public QObject
  23. , public UnitTest::AssetProcessorUnitTestBase
  24. {
  25. Q_OBJECT
  26. protected:
  27. AssetProcessorManagerUnitTests() = default;
  28. ~AssetProcessorManagerUnitTests();
  29. void SetUp() override;
  30. void TearDown() override;
  31. AZStd::string AbsProductPathToRelative(const QString& absolutePath);
  32. void VerifyProductPaths(const JobDetails& jobDetails);
  33. void ProcessAssetBlockUntilComplete(QString& assetToProcess);
  34. QDir m_sourceRoot;
  35. QDir m_cacheRoot;
  36. AZStd::unique_ptr<AssetProcessor::FileStatePassthrough> m_fileStateCache;
  37. AZStd::unique_ptr<UnitTestUtils::ScopedDir> m_changeDir;
  38. FileWatcher m_fileWatcher;
  39. ::UnitTests::MockVirtualFileIO m_virtualFileIO;
  40. AzToolsFramework::UuidUtilComponent m_uuidUtil;
  41. AzToolsFramework::MetadataManager m_metadataManager;
  42. AssetProcessor::UuidManager m_uuidManager;
  43. QList<QMetaObject::Connection> m_assetProcessorConnections;
  44. bool m_idling = false;
  45. QList<JobDetails> m_processResults;
  46. QList<QPair<QString, QString>> m_changedInputResults;
  47. QList<AzFramework::AssetSystem::AssetNotificationMessage> m_assetMessages;
  48. AZStd::unique_ptr<AssetProcessorManagerUnit_Test> m_assetProcessorManager;
  49. PlatformConfiguration m_config;
  50. };
  51. } // namespace assetprocessor