Skip to content

Commit 3bbbaa2

Browse files
Merge branch 'xfiderek/ikos'. Close #138.
2 parents e8ce6c9 + 86fbcd4 commit 3bbbaa2

File tree

3 files changed

+11
-4
lines changed

3 files changed

+11
-4
lines changed

spaceros/Earthfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,7 @@ rosdep:
178178
..
179179
RUN make
180180
RUN sudo make install
181+
ENV PATH="/opt/ikos/bin/:$PATH"
181182
WORKDIR $SPACEROS_DIR
182183
RUN sudo rm -rf ikos/
183184

spaceros/README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -215,26 +215,31 @@ spaceros-user@d10d85c68f0e:~/spaceros$ CC="ikos-scan-cc" CXX="ikos-scan-c++" LD=
215215

216216
## Generating IKOS Results
217217

218-
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:
218+
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:
219219

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

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

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

230-
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.
230+
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.
231231
After running `colcon test`, you can view the JUnit XML files.
232232
For example, to view the JUnit XML file for IKOS scan of the rcpputils binaries you can use the following command:
233233

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

238+
SARIF files are also available in the same path:
239+
```
240+
spaceros-user@d10d85c68f0e:~/spaceros$ more build_ikos/rcpputils/test_results/rcpputils/ikos.sarif
241+
```
242+
238243
## Saving build artifacts locally
239244
`./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.
240245

spaceros/entrypoint.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@ set -e
33

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

0 commit comments

Comments
 (0)