* Moved allocation to avoid crash on gtest_repeat.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
* Fixed GradientSignal tests to work with gtest_repeat.
Signed-off-by: Mike Balfour <82224783+mbalfour-amzn@users.noreply.github.com>
Fixed crash in Allocators Benchmark multithreaded test due to the HPHA schema not having proper multithread protection around the `mFreeTree` member in `tree_get_unused_memory` function.
The `mFreeTree intrusive set is able to modified on multiple threads.
Replaced the custom intrusive_list implementation n HPHA schema with AZStd::intrusive_list
Added a `ScopedAllocatorBenchmarkEnvironment` class to provide an RAI mechanism for initializing the SystemAllocator in Benchmark Test
Rermoved the `AzCoreBenchmarkEnvironment` in lieu of the `ScopedAllocatorBenchmarkEnvironment` class
Fixed assert when running Allocator Benchmarks in debug due to mismatch PauseTiming/ResumeTiming in Allocator Benchmark Fixtures
Added `ScopedRegisterBenchmarkEnvironment` RAII class to provide lifetime guarantees on BenchmarkEnvironments registered via the `AZ_UNIT_TEST_HOOK`
Initialized the intrusive_multiset_node members to nullptr in all build configurations instead of only debug as the cost negligible and it is useful for debugging.
fixes LYN-10210
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* WIP
Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
* Commit before merging
Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
* Added new pngs
Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
* Changes from PR
Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
* Fixed CRC errors
Signed-off-by: John Jones-Steele <82226755+jjjoness@users.noreply.github.com>
Updates and fixes to support GCC for Linux
Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
Co-authored-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Templates/Restricted upgrade/fixes:
Fixed template storage format: templates now only store true relative paths and no longer save "origin" paths and "optional" has been removed, it was never used.
Upgraded all templates to new standard
Template system now correctly handles child objects: Child objects no longer have to specify restricted they inherit from parent
Restricted now operates at the object level and makes no assumptions about parent
Restricted templates can now be combined and seperated on creation
ly_get_list_relative_filename has been deprecated for o3de_pal_dir
All Gems/Projects/Templates updated to use new code
Signed-off-by: byrcolin <byrcolin@amazon.com>
Previously it was using `GetTickCount()` for the creation of the
directory which can collide if0 there are multiple processes
creating a temporary directory via teh ScopedAutoTempDirectory
constructor.
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Adds mac test job
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Points to sysctl properly to handle zsh
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Fixes some macos differences with Linux when reading the CTEST_RUN_FLAGS parameters
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* adding the test job to the profile pipe
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Disables some tests in Mac that are not passing
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* passes config to cli_test_driver and sets the right trait for the test (pytest instead of lytesttools)
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Set proper traits for AtomRHI
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Corrected AZ_TRAIT_UNIT_TEST_PERLINE_GRADIANT_GOLDEN_VALUES_7878 values for Mac
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Disables EMotionFX tests in Mac
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Removes debugging prints
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Removes filters that were meant just for Linux
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* quotes are re-quoted in the test_mac.sh script
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* wip fixes for entity viewport icons displaying in the correct order and handling selection correctly
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add additional comment about z value
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* move manual sorting and some small tidy-up
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update comment
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* updates following initial round of PR feedback
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* additional changes to support tests for entity icon intersection
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* add support to enable/disable icons separately from helpers
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* final tests added and small tidy-up to display EntityId correctly
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update some manipulator test framework calls after utility functions were moved
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* fix for implicit cast
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* move icon scale values to AZ_CVARS
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* fix failing tests caught in AR and update some naming conventions for tests
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update naming convention for members of ProjectedViewportRay
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update other references to ProjectedViewportRay
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update more references to ProjectedViewportRay change
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
* update menus for python tests
Signed-off-by: Tom Hulton-Harrop <82228511+hultonha@users.noreply.github.com>
- Remove trait AZ_TRAIT_DISABLE_FAILED_ATOM_RPI_TESTS
- Add template specialization for ConstantsData::SetConstant<Color> and ConstantsData::GetConstant<Color>
- Remove trait AZ_TRAIT_DISABLE_FAILED_ATOM_RPI_TESTS from source code
- Fix ConstantsData::SetConstantArray<bool> to pass unit test SetConstant_GetConstant_FalsePackedInGarbage_Bool on Linux, cause by an unwanted optimization (comments describe the situation). This will make this behavior consistent across platforms
Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
- Change the test Archive Folder name, Extract Folder Name, and File List file to be all lowercase to prevent the 'ResolvePath' function in LocalFileIO when executed to cause issues on case sensitive file systems (#6277)
- Fix memory corruption in profile builds on Linux when using AZ::IO::PathView by using AZ::IO::FixedMaxPath instead
Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
* Fix failure reason for PerlinGradientComponent_GoldenTest: non-standard behavior of std::shuffle producing different results across platforms
* Fix failure reason for GradientImageAssetConversionU8SingleScale: Undefined behavior when float casts to a uint8 has overflow
Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
* Enable process and ap connection tests on linux
* Updated 'OpenProjectManager' to use new the ProcessLauncher argument type
* Add logic to double-escape escaped double quotes in arguments on windows platforms
* Updated argument for LaunchProjectManager to reflect new ProcessLauncher argument type
* Fixed unit test arguments for 'arg=value' condition
* Fix compile errors for BuilderManager and RHI.Edit\Utils.cpp
* PAL'ify the GetCommandLineParametersAsString() to handle windows specific behavior
Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
Co-authored-by: byrcolin <byrcolin@amazon.com>
* Removed trait AZ_TRAIT_DISABLE_FAILED_INPUT_TESTS (#6078)
* Added check for gamepad support
* Skip tests that rely on gamepad support on platforms that dont support it
* Use GTEST_SKIP(() if available, otherwise just use SUCCEED()
Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
* Removed AZ_TRAIT_DISABLE_FAILED_ZERO_COLOR_CONVERSION_TEST (#6074)
* Protect against 'NaN' (divide by zero) for saturation calculations by setting value to zero instead
Signed-off-by: Steve Pham <82231385+spham-amzn@users.noreply.github.com>
* Merged the Edtiror.Camera.Tests witht eh Editor.Tests
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Adds dependency to Camera.Editor gem which is used by the test
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Inheirts from TraceBusHook instead of adding the default env to the test
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* makes order consistent between Setup/Teardown
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* adds missing header for non-unity builds
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Removes dependency to Camera gem
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Initial support for importing Json files within other Json files
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add some test cases for testing/iterating on the Json import work. Fix MacOS AzTestRunner module loading bug.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* The import resolver can take the allocator as a parameter to Load/StoreImports() instead of storing a copy.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Fix assert
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Some rework of the JsonImport feature. Base test cases pass. More complex test cases need to be added.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Add test case for testing nested imports.
2. Initialize rapidjson value to fix assert.
3. Fix bug found in merge patch creation.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Update the Resolver class member functions to return proper result codes.
2. Add the wrapper functions for resolving/restoring imports to the JsonSerialization class.
3. Add new test case.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add test cases for import + patches. Fix bug found when patching import. Rename test cases.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Add ApplyPatch() function to BaseJsonImporter.
2. Move patch logic out of ResolveImport() and into ApplyPatch()
3. Get rid of the custom RestoreImport implementation in the tests since it was the same as the base version.
4. Add test case for patching nested imports.
5. Update merge patch outcome reporting logic to work for nested object patches.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* 1. Add a CreatePatch() function to BaseJsonImporter to match the ApplyPatch() function.
2. Reorganize some responsibilities between RestoreImports(), RestoreImport() and CreatePatch() to make ResolveImports() and RestoreImports() more symmetrical.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Combine result code in code path where we add empty object to path
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add test case for inserting a new import into an existing object.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Use == instead of Compare() for comparing file paths.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Address some PR feedback.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Address additional PR feedback
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Add missing includes to fix non-unity build
Signed-off-by: amzn-sj <srikkant@amazon.com>
* Fix build error. Address additional feedback.
Signed-off-by: amzn-sj <srikkant@amazon.com>
* fixes some warnings for newer versions of VS2022
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* more warning fixes
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* remove integ test filters from AzTest
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* remove integ test handling from AzTestRunner
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* changes integ tests of gridmate to regular tests and disables failing ones
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* removes the Integ from the EMotionFX tests, but leaves them disabled since they are failing
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* removes the Integ from the HttpRequestor tests and disables it since is not passing
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* changing integ tests for DISABLED, these ones are using files that are not there
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* fixes linux build
gridmate tests that were Integ are now disabled
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* fixes linux warnings
Signed-off-by: Esteban Papp <81431996+amznestebanpapp@users.noreply.github.com>
* Added IsDirectory function to SystemFile
This takes the implementation in LocalFileIO and uses it for SystemFile
and then just has LocalFileIO call the SystemFile implementation
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Fixed logic to detect the WinApi FILE_ATTRIBUTE_DIRECTORY attribute
Updated the FileIO.cpp test to use AZ::IO::Path and removed direct uses
of AZStd::string
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Adding googletest printers for string and Path classes
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Updated the SystemFile_WinAPI functions to use AZStd::to_wstring
This makes the the SystemFile function convert from UTF-8 to UTF-16
Signed-off-by: lumberyard-employee-dm <56135373+lumberyard-employee-dm@users.noreply.github.com>
* Modernization + small fix.
Modernize ( `bool`/`override`/other) code in AzCore, AzFramework, AzQtComponents, AzToolsFramework, etc.
Replaced a `bind` or two, use `using` in a few places as well.
Fix nullptr comparison of AZStd::function.
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Apply review-based changes
Signed-off-by: nemerle <96597+nemerle@users.noreply.github.com>
* Final update copyright headers to reference license files at the repo root
Signed-off-by: spham <spham@amazon.com>
* Fix copyright validator unit tests to support the stale O3DE header scenario
Signed-off-by: spham <spham@amazon.com>
* Fix Delete_Real_Readonly_Fails to mark parent directory as read-only as well
Read-only files in Windows cannot be deleted. The previous version of this
code relied on that fact, and would attempt to delete a file even when
`skipReadOnly = true`, relying on the OS to refuse to delete the file if it
is read only. On Linux, it is the writable state of the *directory* that
determines if a file can be deleted or not. This fixes the test to set up
the correct situation where a file deletion would fail.
* Remove excluded items from a vector before iterating over it
Removing items from the `pathMatches` `QStringList` while iterating over it
was causing a segfault on Linux. This change separates out the item removal
from the item iteration, which allows the item iteration loop to use a
range-for loop instead of directly manipulating iterators.
* Remove invalid test that asserts a file's metadata file can have differing file casing
This test is asserting that a given source file and its accompanying
metadata file can have the the same name but differing case. This is really
testing whether or not the underlying filesystem that those files live on
is case sensitive or not. The 99% chance is that users are using the
default filesystem that their host OS gives them, NTFS on Windows, EXT* on
Linux, and APFS on Mac. Even though NTFS is case-insensitive by default,
it [can be configured per-directory](https://devblogs.microsoft.com/commandline/improved-per-directory-case-sensitivity-support-in-wsl/).
APFS as well can be configured to be case-sensitive. For users with case
sensitive filesystems, this test makes no sense. We could extend this test
to inspect the case-sensitivity of the underlying filesystem, but then it
is just testing the filesystem's behavior, which seems out of scope of this
test.
* Use a non-priviliged port for the Asset Processor tests
From https://www.w3.org/Daemon/User/Installation/PrivilegedPorts.html:
> The TCP/IP port numbers below 1024 are special in that normal users are not
> allowed to run servers on them. This is a security feaure, in that if you
> connect to a service on one of these ports you can be fairly sure that you
> have the real thing, and not a fake which some hacker has put up for you.
>
> When you run a server as a test from a non-priviliged account, you will
> normally test it on other ports, such as 2784, 5000, 8001 or 8080.
* Fix for `QDir::rmdir(".")` not working in Linux
Qt uses `::rmdir` to remove directories on Linux. This comes from
[unistd.h](https://pubs.opengroup.org/onlinepubs/007904875/functions/rmdir.html)
The documentation for that function states:
> If the path argument refers to a path whose final component is either dot
> or dot-dot, rmdir() shall fail.
So calling `dir.rmdir(".")` will never work on Linux.
Instead, get the parent directory, and remove the child directory by name.
* Avoid lowercasing source asset paths when resolving dependencies
Source asset paths may be case sensitive, so their case must be preserved
when doing operations that hit the underlying filesystem. This method was
always lowercasing them, which would cause dependencies to not be found.
* Correct test to expect product filenames to be lowercase
The modtime tests were failing in Linux due to something unrelated to file
modtime checking. The Asset Processor Manager does this during AnalyzeJob:
```
if (foundInDatabase && jobs[0].m_fingerprint == jobDetails.m_jobEntry.m_computedFingerprint)
{
// If the fingerprint hasn't changed, we won't process it.. unless...is it missing a product.
```
In this case, the test was setting up a product whose file case was the
same as the source asset, and would write it to the cache dir using mixed
case, but use the normal asset processor API to write the product file path
to the database, which recorded the path in lowercase. When the manager
then went to check if the source asset's products all exist, it checked the
lowercase path, which didn't exist.
This fixes that test failure, by updating the test to write the product
file to the cache using the proper lowercased path.
* Update test to define a "not current platform" for Linux
This test was failing because it was setting some "not current platform"
variable to be set to "pc" on Linux, when
`AssetSystem::GetHostAssetPlatform()` is defined to:
```cpp
inline const char* GetHostAssetPlatform()
{
return "mac";
return "pc";
// set this to pc because that's what bootstrap.cfg currently defines the platform to "pc", even on Linux
return "pc";
#error Unimplemented Host Asset Platform
}
```
The test would go on to assert that "pc" was simultaneously in a list and
not in the same list.
This fixes the test by updating the code to set the "not the current
platform" variable appropriately on Linux.
The expectations were also updated to improve the output on test failure.
Instead of this:
```
Value of: recogs["rend"].m_platformSpecs.contains(platformWhichIsNotCurrentPlatform)
Actual: true
Expected: false
```
You now get this:
```
Value of: recogs["rend"].m_platformSpecs.keys()
Expected: (has 3 elements and there exists some permutation of elements such that:
- element #0 is equal to pc, and
- element #1 is equal to es3, and
- element #2 is equal to server) and (doesn't contain any element that is equal to pc)
Actual: { pc, server, es3 } (of type QList<QString>), whose element #0 matches
```
* Prevent windows supported path separators to be included in the test paths for UpdateToCorrectCase_ExistingFile_ReturnsTrue_CorrectsCase
* Fix failing linux unit test "PlatformConfigurationUnitTests.TestFailReadConfigFile_RegularScanfolder"
caused by static variable not being reset from a different test run when using AssetUtilities::ComputeProjectPath
* Fix AZ_RTTI declaration for RequestEscalateAsset Message
* Implement FileWatcher for Linux to fix AssetProcessorMessages.All test (RequestAssetStatus)
* Split AssetProcessorMessages into 2 tests, one with RequestAssetStatus/ResponseAssetStatus and one without
Add The RequestAssetStatus/ResponseAssetStatus as a sandbox test because it relies on FileWatcher thread and seems to be timing related
* Remove FileWatcher_win.cpp from the Linux specific folder for FileWatcher
* - Fix build error related to non-unity builds
- Fixed failed linux test 'Test/LegacyTestAdapter.AllTests/UtilitiesUnitTest' caused by misplaced windows only EXPECT
- Remove test trait AZ_TRAIT_DISABLE_FAILED_ASSET_PROCESSOR_TESTS for linux to expose remaining failed tests
* Fixed failed linux test 'Test/LegacyTestAdapter.AllTests/RCcontrollerUnitTests' caused by misplaced windows only EXPECT
* - Fix FileWatcher unit test, disable incompatible subtests for Linux
- Fix errors in FileWatcher_linux from results of the FileWatcher Unit Test
* Remove AZ::AssetProcessor.Tests.Sandbox tests from definition and restore the original AssetProcessorMessages.All tests now that Filewatcher_linux was fixed
* Fixes for failed unit tests: AssetProcessorManagerUnitTests and AssetProcessorManagerUnitTests_JobDependencies_Fingerprint
- Caused by differences between between case-sensitive files (Linux) and non-case-sensitive Filesystems (Windows)
* Update consts in FileWatcher_linux.cpp to constexpr
* Fixes related to PR comment suggestions
* - Removed std::bind and replaced with lambda in FileWatcher_linux
- Replaced String replace functions for path separators to use AZ::IO::Path::LexicallyNormal() instead
* Restoring string replace function in PathDependencyManager::ResolveDependencies due to unit test failure
Co-authored-by: Chris Burel <burelc@amazon.com>
* should pickup the external directories registered by the project
* Add support for AzTest and AzTestRunner in the SDK
* missing IMPORT_LIB
* Moved where .Assets targets get generated so they are visible in the SDK
* generate the Directory.Build.props in the right path
* excluding target on platforms that dont support it
- Enable the previously failing network unit tests for TcpTransportTests for Linux: TestSingleClient and TestMultipleClients
- Switch Linux to use SELECT implementation of the TCP Socket Manager instead of the EPOLL version (root cause of the failure)