amazon-ion / ion-cli

Apache License 2.0
33 stars 15 forks source link

Adds integration tests for code generator #95

Closed desaikd closed 6 months ago

desaikd commented 6 months ago

Issue #88:

Description of changes:

This PR works on adding pre-defined code gen test projects and roundtrip tests for the generated code.

List of changes:

Sample of running tests on ion-cli for code generator:

   Running tests/code-gen-tests.rs 

running 2 tests
     Removed X files, YMiB total
Starting a Gradle Daemon (subsequent builds will be faster)
> Task :clean

> Task :ionCodegen
Started generating code...
Code generation complete successfully!
Path to generated code: ion-cli/code-gen-projects/java/code-gen-demo/build/generated/java

> Task :compileJava
> Task :processResources NO-SOURCE
> Task :classes
> Task :compileTestJava
> Task :processTestResources NO-SOURCE
> Task :testClasses
> Task :test

BUILD SUCCESSFUL in Zs
5 actionable tasks: 5 executed
test roundtrip_tests_for_generated_code_gradle ... ok

running 3 tests
test tests::it_works ... ok
test tests::test_roundtrip_generated_code_structs_with_fields ... ok
test tests::test_roundtrip_generated_code_nested_structs ... ok

test result: ok. 3 passed; 0 failed; 0 ignored; 0 
....
test roundtrip_tests_for_generated_code_cargo ... ok

test result: ok. 2 passed; 0 failed; 0 ignored; 0 

Tests


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.