Skip to content

Commit

Permalink
test(linter): update linter spread test for core24
Browse files Browse the repository at this point in the history
  • Loading branch information
syu-w authored and mr-cal committed Apr 18, 2024
1 parent ab37ec3 commit c9ab9d1
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
Running linters...
Running linter: library
Lint warnings:
- library: linter-test: missing dependency 'libcaca.so.0'. (https://snapcraft.io/docs/linters-library)
- library: libpng16.so.16: unused library 'usr/lib/x86_64-linux-gnu/libpng16.so.16.37.0'. (https://snapcraft.io/docs/linters-library)
Lint warnings:
- library: linter-test: missing dependency 'libcaca.so.0'. (https://snapcraft.io/docs/linters-library)
- library: libogg.so.0: unused library 'usr/lib/x86_64-linux-gnu/libogg.so.0.8.5'. (https://snapcraft.io/docs/linters-library)
2 changes: 1 addition & 1 deletion tests/spread/core24/linters-file/lint-file/snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@ parts:
- gcc
- libcaca-dev
stage-packages:
- libpng16-16
- libogg0
override-build:
gcc -o $CRAFT_PART_INSTALL/linter-test test.c -lcaca
16 changes: 13 additions & 3 deletions tests/spread/core24/linters-file/task.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,19 @@ execute: |
# build the test snap destructively to save time
snapcraft --destructive-mode
snapcraft lint lint-file_0.1_*.snap 2> output.txt
snapcraft lint lint-file_0.1_*.snap 2> output.txt || {
lxc --project snapcraft start snapcraft-linter &&
sleep 10 &&
lxc --project snapcraft exec snapcraft-linter -- snap install --edge core24 &&
snapcraft lint lint-file_0.1_*.snap 2> output.txt
}
# TODO: restore this when core24 is stable
# core24 testing has undefined symbol warnings
# get the lint warnings at end of the log file
sed -n '/Running linters.../,+4 p' < output.txt > linter-output.txt
#sed -n '/Running linters.../,+4 p' < output.txt > linter-output.txt
diff -u linter-output.txt expected-linter-output.txt
#diff -u linter-output.txt expected-linter-output.txt
MATCH "library: linter-test: missing dependency 'libcaca.so.0'" < output.txt
MATCH "library: libogg.so.0: unused library" < output.txt

0 comments on commit c9ab9d1

Please sign in to comment.