Skip to content

Commit

Permalink
tests: add a simple test for the Clang analyzer plugin
Browse files Browse the repository at this point in the history
Related: csutils#93
  • Loading branch information
lzaoral committed Feb 2, 2023
1 parent 16818ee commit 8f40754
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
5 changes: 5 additions & 0 deletions plans/example.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
summary: Basic analysis tests
discover:
how: fmf
execute:
how: tmt
9 changes: 9 additions & 0 deletions tests/example/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
summary: Test analysis using Clang analyzer
test: ./test.sh
framework: beakerlib
component:
- csmock
recommend:
- csmock
- csmock-plugin-clang
duration: 1h
25 changes: 25 additions & 0 deletions tests/example/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
# vim: dict+=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k
. /usr/share/beakerlib/beakerlib.sh || exit 1

PACKAGES="csmock csmock-plugin-clang"

rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "pushd $tmp"

rlRun "dnf -y update coreutils" 0-255
rlRun "rlFetchSrcForInstalled coreutils"
rlRun "SRPM=\$(find . -name 'coreutils-*.src.rpm')"
rlPhaseEnd

rlPhaseStartTest
rlRun "csmock -t clang '$SRPM'" 0 "Analyze $SRPM using Clang analyzer"
rlPhaseEnd

rlPhaseStartCleanup
rlRun "popd"
rlRun "rm -r $tmp" 0 "Remove tmp directory"
rlPhaseEnd
rlJournalEnd

0 comments on commit 8f40754

Please sign in to comment.