JSON-to-Swift-Converter icon indicating copy to clipboard operation
JSON-to-Swift-Converter copied to clipboard

Add a test that invokes the Swift compiler on generated code

Open mrlegowatch opened this issue 9 years ago • 1 comments

Although there are unit tests to validate the expected behavior of the extension, there is no test whether generated code is valid for the Swift compiler. It would be useful to have a test that validates generated code using the Swift compiler. This would require implementing wrapper struct type and substitution for embedded struct type names.

mrlegowatch avatar Apr 08 '17 18:04 mrlegowatch

Submitted a unit test to perform this; however, app sandboxing apparently won't allow running the swiftc compiler (using Foundation Process object). A manual workaround is to open the test's generated temporary source files, and paste them into a Playground, to determine if the converter generated code with compiler errors. See SwiftOutputTests.swift for details.

mrlegowatch avatar Mar 15 '18 11:03 mrlegowatch