# Export Test Results You can export test results in the JUnit XML format specified [here](https://llg.cubic.org/docs/junit/). You can specify a file name to export to, or kick off an export in a [post-run hook](Hooks). ## Setting the export file There are two settings, the file name and a flag to include an epoch timestamp in the filename. The epoch timestamp will prevent runs from overwriting the last run's file. * Gut Panel * Set `Output Path` in the XML Output section in the Gut Panel * Check `Include Timestamp` if you want the timestamp to be included. * Command Line * Set `-gjunit_xml_file` to the path. * Add option `-gjunit_xml_timestamp` to include the timestamp. * `.gutconfig.json` File * `"junit_xml_file":"user://results.xml"` * `"junit_xml_timestamp":false` * Inspector * Set `Junit Xml File` to the path. * Check `Junit Xml Timestamp` if you want the timestamp to be included. ## Example Output ``` xml Cannot compare Int[1] to String["two"]. at line 7 this has text this has text (call #1) [1] expected to equal [2]: at line 25 Cannot compare String["two"] to Int[2]. at line 13 Cannot compare Int[1] to String["two"]. at line 10 this has text Cannot compare Int[1] to String["two"]. at line 11 this has text Cannot compare Int[1] to String["two"]. at line 26 ``` ## Exporting results in post-run Hook If you would like more control over exporting the results you can do so manually in a post-run hook. See [Hooks](Hooks) for more information about setting up a post-run script. Note that `JunitXmlExport` and `gut` are defined by the parent script `res://addons/gut/hook_script.gd` ``` gdscript extends GutHookScript func run() # called automatically by Gut var exporter = JunitXmlExport.new() var filename = 'user://my_post_hook_results.xml' var f_result = exporter.write_file(gut, filename) if(f_result == OK): gut.p(str("Results saved to ", filename)) ```