You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
o3de/Code/Framework/AzTest
SJ c871224dae
Support for importing Json files (#4609)
* 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>
4 years ago
..
AzTest Support for importing Json files (#4609) 4 years ago
CMakeLists.txt Shorten copyright headers by splitting into 2 lines (#2213) 4 years ago