### Install xcresultparser with Homebrew Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Use this command to install the xcresultparser tool via the Homebrew package manager. ```bash brew install xcresultparser ``` -------------------------------- ### Install xcresultparser Binary Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Copy the downloaded xcresultparser binary to the /usr/local/bin directory for system-wide access. This command assumes the binary is on your Desktop. ```bash cp ~/Desktop/xcresultparser /usr/local/bin/ ``` -------------------------------- ### Verify xcresultparser Installation Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Run this command in the Terminal to confirm that xcresultparser is installed and accessible in your system's search path. A successful verification shows the tool's usage information. ```bash xcresultparser ``` -------------------------------- ### Show Version Number Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Display the installed version of the xcresultparser tool. This command is useful for checking compatibility or reporting issues. ```bash xcresultparser -v ``` -------------------------------- ### Open Build Output Directory Source: https://github.com/a7ex/xcresultparser/blob/main/README.md After building the project, use this command to open the directory containing the release executable in Finder. The xcresultparser binary will be located here. ```bash open .build/release ``` -------------------------------- ### Build xcresultparser from Source Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Build the xcresultparser executable from the source code using Swift's build tool. This command compiles the project in release mode. ```bash swift build -c release ``` -------------------------------- ### Grant Execute Permission to Downloaded Binary Source: https://github.com/a7ex/xcresultparser/blob/main/README.md After downloading the xcresultparser binary, use this command to grant it execute permissions. This is necessary before running the tool. ```bash chmod +x ~/Desktop/xcresultparser ``` -------------------------------- ### xcresultparser Help Information Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Display the help message for xcresultparser, which includes a detailed list of available options and arguments. This is useful for understanding all functionalities. ```bash xcresultparser -h ``` -------------------------------- ### Generate SonarQube Coverage XML (Specific Targets) Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Creates a code coverage XML file for specific targets (e.g., 'foo' and 'baz'). If a specified target does not exist, the command will now exit with an error. ```bash xcresultparser -c -o xml test.xcresult -t foo -t baz > sonarCoverage.xml ``` -------------------------------- ### Output to CLI Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Display the parsed .xcresult file content directly in the terminal using the 'cli' output format. This is suitable for quick inspection of results. ```bash xcresultparser -o cli test.xcresult ``` -------------------------------- ### Generate SonarQube Coverage XML (All Targets) Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Generates an XML file in the generic code coverage format for all targets, suitable for SonarQube. Ensure the test.xcresult file is correctly specified. ```bash xcresultparser -c -o xml test.xcresult > sonarCoverage.xml ``` -------------------------------- ### Generate HTML Output Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Create a single HTML file containing test data. This output format provides an interactive and visually organized report of test results. ```bash xcresultparser -o html test.xcresult > testResult.html ``` -------------------------------- ### Write Text Output to File Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Redirect the standard output of xcresultparser to a file named 'output.txt' on your Desktop. This is useful for saving the parsed results in a text format. ```bash xcresultparser -o txt test.xcresult > ~/Desktop/output.txt ``` -------------------------------- ### Generate SonarQube Test Execution XML Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Creates an XML file in the generic test execution format for SonarQube. This is useful for integrating test results into SonarQube analysis. ```bash xcresultparser -o xml test.xcresult > sonarTestExecution.xml ``` -------------------------------- ### Generate JUnit XML Output Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Create an XML file in JUnit format from a .xcresult file. This format is commonly used for integrating test results with CI/CD systems. ```bash xcresultparser -o junit test.xcresult > junit.xml ``` -------------------------------- ### Merge xcresult Files Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Use the xcrun xcresulttool command to merge two .xcresult files into a single output file. This is helpful for combining test results from different runs or configurations. ```bash xcrun xcresulttool merge Result1.xcresult Result2.xcresult --output-path=Result_merged.xcresult ``` -------------------------------- ### Convert Absolute Paths to Relative for SonarQube Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Uses the --project-root option to convert absolute file paths within the xcresult to relative paths. This is crucial when the SonarQube scanner runs in a different directory than where the xcresult was generated. ```bash ./xcresultparser -c -o xml --project-root "work/myApp/" test.xcresult > sonar.xml ``` -------------------------------- ### Generate Cobertura XML Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Outputs an XML file in the Cobertura format, which is useful for importing into tools like GitLab's coverage visualizer. Line coverage information is intended to be accurate. ```bash xcresultparser -o cobertura test.xcresult > cobertura.xml ``` -------------------------------- ### Egrep for SonarQube Class to File Mapping Source: https://github.com/a7ex/xcresultparser/blob/main/README.md This egrep command is used to find Swift and Objective-C class definitions within project files. It helps map class names found in xcresult to their corresponding file paths for SonarQube scanning. ```bash egrep -rio --include "*.swift" --include "*.m" "^(?:public )?(?:final )?(?:public )?(?:(class|\@implementation) )\w+" $project-root ``` -------------------------------- ### Generate Markdown Output Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Produces simple Markdown formatting for test results, often used for display in platforms like Teams Webhooks. This provides a human-readable summary of test outcomes. ```bash xcresultparser -o md test.xcresult > teamsWebhook.txt ``` -------------------------------- ### Generate Errors JSON Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Creates a JSON file detailing any errors encountered during the parsing of the xcresult archive. This output is helpful for debugging and understanding issues. ```bash xcresultparser -o errors test.xcresult > errors.json ``` -------------------------------- ### Generate Code Climate Warnings JSON Source: https://github.com/a7ex/xcresultparser/blob/main/README.md Outputs JSON data formatted for Code Climate checks. This is useful for integrating static analysis results into CI/CD pipelines that support the Code Climate standard. ```bash xcresultparser -o warnings test.xcresult > climate.json ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.