1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
|
summary: Build the test suite for C code using gcc and run it
details: |
Parts of snapd are implemented in C. We want to make sure that
snapd can be built with CC=gcc, and that all the C-based unit tests pass.
prepare: |
# Precondition check, the core snap is installed
snap info core | MATCH "installed:"
# Install build dependencies for the test
dpkg --get-selections > pkg-list
# Remove any autogarbage from sent by developer
rm -rf "$SPREAD_PATH/cmd/"{autom4te.cache,configure,test-driver,config.status,config.guess,config.sub,config.h.in,compile,install-sh,depcomp,build,missing,aclocal.m4,Makefile,Makefile.in}
make -C "$SPREAD_PATH/cmd" distclean || true
restore: |
# Remove autogarbage leftover from testing
rm -rf "$SPREAD_PATH/cmd/"{autom4te.cache,configure,test-driver,config.status,config.guess,config.sub,config.h.in,compile,install-sh,depcomp,build,missing,aclocal.m4,Makefile,Makefile.in}
# Remove the build tree
rm -rf "$SPREAD_PATH/cmd/autogarbage/"
# Remove any installed packages
dpkg --set-selections < pkg-list
debug: |
# Show the test suite failure log if there's one
cat "$SPREAD_PATH/cmd/autogarbage/test-suite.log" || true
execute: |
cd "$SPREAD_PATH/cmd/"
build_dir="$SPREAD_PATH/cmd/autogarbage"
BUILD_DIR=$build_dir ./autogen.sh
cd "$build_dir"
# Build and run unit tests as root and as a user
make check
chown -R test:test "$build_dir"
su test -c 'make check'
|