Skip to content

Commit 9fd5844

Browse files
Mark R. Tuttlemarkrtuttle
authored andcommitted
Add ctags unit test to github workflow
1 parent 1753d2c commit 9fd5844

File tree

6 files changed

+8314
-0
lines changed

6 files changed

+8314
-0
lines changed

.github/workflows/ctags.yaml

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
name: Test generating symbols from ctags
2+
on:
3+
pull_request:
4+
types: [opened, synchronize, reopened, labeled, unlabeled]
5+
6+
jobs:
7+
legacy:
8+
name: Legacy ctags test
9+
runs-on: macos-latest
10+
steps:
11+
- uses: actions/checkout@v3
12+
with:
13+
fetch-depth: 0
14+
- name: Install viewer
15+
run: |
16+
make install
17+
- name: Install brew packages
18+
run: |
19+
brew uninstall ctags || true
20+
brew uninstall universal-ctags || true
21+
brew install cbmc cbmc-starter-kit litani
22+
- name: Build goto
23+
run: |
24+
cd tests/unit-tests/ctags
25+
make clone
26+
pushd coreHTTP/test/cbmc
27+
cbmc-starter-kit-update --remove-litani --remove-starter
28+
popd
29+
make build
30+
- name: Test legacy ctags
31+
run: |
32+
cd tests/unit-tests/ctags
33+
ctags || true
34+
make legacy
35+
36+
exuberant:
37+
name: Exuberant ctags test
38+
runs-on: macos-latest
39+
steps:
40+
- uses: actions/checkout@v3
41+
with:
42+
fetch-depth: 0
43+
- name: Install viewer
44+
run: |
45+
make install
46+
- name: Install brew packages
47+
run: |
48+
brew uninstall ctags || true
49+
brew uninstall universal-ctags || true
50+
brew install cbmc cbmc-starter-kit litani ctags
51+
- name: Build goto
52+
run: |
53+
cd tests/unit-tests/ctags
54+
make clone
55+
pushd coreHTTP/test/cbmc
56+
cbmc-starter-kit-update --remove-litani --remove-starter
57+
popd
58+
make build
59+
- name: Run exuberant ctags test
60+
run: |
61+
cd tests/unit-tests/ctags
62+
ctags --version
63+
make exuberant
64+
65+
universal:
66+
name: Universal ctags test
67+
runs-on: macos-latest
68+
steps:
69+
- uses: actions/checkout@v3
70+
with:
71+
fetch-depth: 0
72+
- name: Install viewer
73+
run: |
74+
make install
75+
- name: Install brew packages
76+
run: |
77+
brew uninstall ctags || true
78+
brew uninstall universal-ctags || true
79+
brew install cbmc cbmc-starter-kit litani universal-ctags
80+
- name: Build goto
81+
run: |
82+
cd tests/unit-tests/ctags
83+
make clone
84+
pushd coreHTTP/test/cbmc
85+
cbmc-starter-kit-update --remove-litani --remove-starter
86+
popd
87+
make build
88+
- name: Run universal ctags test
89+
run: |
90+
cd tests/unit-tests/ctags
91+
ctags --version
92+
make universal

tests/unit-tests/ctags/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
coreHTTP
2+
symbol.json

tests/unit-tests/ctags/Makefile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# The FreeRTOS coreHTTP respository
2+
REPO_DIR = coreHTTP
3+
REPO_URL = https://github.com/FreeRTOS/coreHTTP.git
4+
5+
# Paths in the repository
6+
PROOF_DIR = test/cbmc/proofs
7+
8+
# Proofs in the repository
9+
PROOF = HTTPClient_AddRangeHeader
10+
11+
UNIVERSAL=$$(ctags --version | grep Universal)
12+
EXUBERANT=$$(ctags --version | grep Exuberant)
13+
14+
default: clone build compare
15+
16+
# Clone the repository
17+
clone:
18+
$(RM) -r $(REPO_DIR)
19+
git clone $(REPO_URL) $(REPO_DIR)
20+
cd $(REPO_DIR); git submodule update --init --checkout --recursive
21+
22+
# Run a proofs
23+
# EXTERNAL_SAT_SOLVER= to ensure cbmc uses minisat and not kissat
24+
build:
25+
cd $(REPO_DIR)/$(PROOF_DIR)/$(PROOF); \
26+
EXTERNAL_SAT_SOLVER= \
27+
make goto
28+
29+
symbol:
30+
cbmc-viewer symbol \
31+
--goto $(REPO_DIR)/$(PROOF_DIR)/$(PROOF)/gotos/$(PROOF)_harness.goto \
32+
--srcdir $(REPO_DIR) > symbol.json
33+
34+
legacy: symbol
35+
diff symbol.json symbol-legacy.json
36+
37+
exuberant: symbol
38+
diff symbol.json symbol-exuberant.json
39+
40+
universal: symbol
41+
diff symbol.json symbol-universal.json
42+
43+
clean:
44+
$(RM) *~ symbol.json
45+
46+
veryclean: clean
47+
$(RM) -r $(REPO_DIR)

0 commit comments

Comments
 (0)