Skip to content

Commit

Permalink
Update instructions on running ikos-scan in README (#138).
Browse files Browse the repository at this point in the history
The current instructions specify how to re-run all tests, which takes
substantial time. This change explains how to run ikos-scan specifically, which
should be faster than running all tests.
  • Loading branch information
xfiderek authored and ivanperez-keera committed Apr 26, 2024
1 parent d5f3426 commit 86fbcd4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions spaceros/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,26 +215,31 @@ spaceros-user@d10d85c68f0e:~/spaceros$ CC="ikos-scan-cc" CXX="ikos-scan-c++" LD=

## Generating IKOS Results

To generate JUnit XML files for all of the binaries resulting from the build command in the previous step, you can use **colcon test**, as follows:
To generate JUnit XML/SARIF files for all of the binaries resulting from the build command in the previous step, you can use **colcon test**, as follows:

```
spaceros-user@d10d85c68f0e:~/spaceros$ colcon test --build-base build_ikos --install-base install_ikos
spaceros-user@d10d85c68f0e:~/spaceros$ colcon test --build-base build_ikos --install-base install_ikos --ctest-args -L "ikos"
```

To generate a JUnit XML file for a specific package only, you can add the *--packages-select* option, as follows:

```
spaceros-user@d10d85c68f0e:~/spaceros$ colcon test --build-base build_ikos --install-base install_ikos --packages-select rcpputils
spaceros-user@d10d85c68f0e:~/spaceros$ colcon test --build-base build_ikos --install-base install_ikos --ctest-args -L "ikos" --packages-select rcpputils
```

The `colcon test` command runs various tests, including IKOS report generation, which reads the IKOS database generated in the previous analysis step and generates a JUnit XML report file.
The `colcon test` command with the `-L "ikos"` flag runs IKOS report generation, which reads the IKOS database generated in the previous analysis step and generates a JUnit XML report file.
After running `colcon test`, you can view the JUnit XML files.
For example, to view the JUnit XML file for IKOS scan of the rcpputils binaries you can use the following command:

```
spaceros-user@d10d85c68f0e:~/spaceros$ more build_ikos/rcpputils/test_results/rcpputils/ikos.xunit.xml
```

SARIF files are also available in the same path:
```
spaceros-user@d10d85c68f0e:~/spaceros$ more build_ikos/rcpputils/test_results/rcpputils/ikos.sarif
```

## Saving build artifacts locally
`./build.sh` script executes the Earthly `build` task defined in `Earthfile`, which copies specified artifacts from the container to the host. Additional tasks defined in the Earthfile enable the preservation of intermediate artifacts generated during the build process.

Expand Down

0 comments on commit 86fbcd4

Please sign in to comment.