Skip to content

Commit

Permalink
Merge branch 'xfiderek/ikos'. Close #138.
Browse files Browse the repository at this point in the history
  • Loading branch information
ivanperez-keera committed Apr 26, 2024
2 parents e8ce6c9 + 86fbcd4 commit 3bbbaa2
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 4 deletions.
1 change: 1 addition & 0 deletions spaceros/Earthfile
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ rosdep:
..
RUN make
RUN sudo make install
ENV PATH="/opt/ikos/bin/:$PATH"
WORKDIR $SPACEROS_DIR
RUN sudo rm -rf ikos/

Expand Down
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
1 change: 1 addition & 0 deletions spaceros/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ set -e

# Setup the Space ROS environment
source "${SPACEROS_DIR}/install/setup.bash"
export IKOS_SCAN_NOTIFIER_FILES="" # make ikos create .ikosbin files for compiled packages
exec "$@"

0 comments on commit 3bbbaa2

Please sign in to comment.