@@ -29,6 +29,10 @@ teardown() {
2929
3030 run cmake --build --preset gcc-arm-none-eabi
3131 assert_success
32+
33+ run readelf -h build/gcc-arm-none-eabi/gcc-arm-none-eabi/test-gcc-arm-none-eabi
34+ assert_output --partial " Type: EXEC"
35+ assert_output --partial " Machine: ARM"
3236}
3337
3438# bats test_tags=tc:4
@@ -41,16 +45,35 @@ teardown() {
4145}
4246
4347# bats test_tags=tc:5
44- @test " ccache can be used as a compiler launcher" {
48+ @test " using ccache as a compiler launcher should result in cached build" {
49+ run ccache --clear --zero-stats
50+
51+ run cmake --preset gcc -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
52+ assert_success
53+
54+ run cmake --build --preset gcc
55+ assert_success
56+
57+ run ccache -s
58+ assert_output --partial " Hits: 0"
59+ assert_output --partial " Misses: 1"
60+
61+ run rm -rf build
62+ run ccache --zero-stats
63+
4564 run cmake --preset gcc -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CXX_COMPILER_LAUNCHER=ccache
4665 assert_success
4766
4867 run cmake --build --preset gcc
4968 assert_success
69+
70+ run ccache -s
71+ assert_output --partial " Hits: 1"
72+ assert_output --partial " Misses: 0"
5073}
5174
5275# bats test_tags=tc:6
53- @test " clang-tidy should be run as part of the build" {
76+ @test " running clang-tidy as part of the build should result in warning diagnostics " {
5477 run cmake --preset clang
5578 assert_success
5679
@@ -60,7 +83,7 @@ teardown() {
6083}
6184
6285# bats test_tags=tc:7
63- @test " include-what-you-use should be run as part of the build" {
86+ @test " running include-what-you-use as part of the build should result in warning diagnostics " {
6487 run cmake --preset clang
6588 assert_success
6689
@@ -70,7 +93,7 @@ teardown() {
7093}
7194
7295# bats test_tags=tc:8
73- @test " formatting tool included in image should format code" {
96+ @test " running clang-format should result in re-formatted code" {
7497 run clang-format clang-tools/unformatted.cpp
7598 assert_success
7699 assert_output " int main() {}"
@@ -129,3 +152,26 @@ teardown() {
129152 run arm-none-eabi-gdb --version
130153 assert_success
131154}
155+
156+ # bats test_tags=tc14
157+ @test " clangd should be able check source files" {
158+ run clangd --check=gcc/main.cpp
159+ assert_success
160+ assert_output --partial " All checks completed, 0 errors"
161+ }
162+
163+ # bats test_tags=tc:15
164+ @test " using lld as an alternative linker should result in working host executable" {
165+ run cmake --preset gcc
166+ assert_success
167+
168+ run cmake --build --preset gcc-lld
169+ assert_success
170+
171+ run readelf --string-dump .comment build/gcc/gcc/test-gcc-lld
172+ assert_output --partial " Linker: Ubuntu LLD"
173+
174+ run build/gcc/gcc/test-gcc-lld
175+ assert_success
176+ assert_output " Hello World!"
177+ }
0 commit comments