Update build scripts, add valgrind support.

This commit is contained in:
Kyle Isom 2023-10-21 20:19:03 -07:00
parent 19fa0c147d
commit c1629dda81
7 changed files with 41 additions and 10 deletions

View File

@ -1,5 +1,7 @@
#!/usr/bin/env bash
set -eu
######################################################################
# @author : kyle (kyle@imap.cc)
# @file : build-all-containers.sh
@ -14,6 +16,6 @@
for container_file in Containerfile.*
do
flavor="${container_file#Containerfile.}"
./build-container.sh Container.${flavor} sc/dev:${flavor}
./build-container.sh Containerfile.${flavor} sc/dev:${flavor}
done

View File

@ -14,6 +14,9 @@ CONTAINERFILE="${1}"
IMAGE_NAME="git.wntrmute.dev/${2}"
podman build -t ${IMAGE_NAME} -f ${CONTAINERFILE}
podman push ${IMAGE_NAME}
podman container prune --force
podman image prune --force
if [ "${BUILD_NO_PUSH:-no}" != "yes" ]
then
podman push ${IMAGE_NAME}
#podman container prune --force
#podman image prune --force
fi

View File

@ -10,6 +10,8 @@
set -eux
BUILD_TYPE="${BUILD_TYPE:-Debug}"
if [ "${USE_CLANG:-}" == "yes" ]
then
export CC=$(command -v clang)
@ -17,4 +19,4 @@ then
fi
mkdir -p build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo .. && make all test && ctest
cmake -DCMAKE_BUILD_TYPE=${BUILD_TYPE} .. && make all test

22
cmake-run-valgrind.sh Executable file
View File

@ -0,0 +1,22 @@
#!/bin/sh
set -eux
if [ ! -d build ]
then
echo "[!] build step not completed!" > /dev/stderr
exit 1
fi
cd build
for testbin in test_*
do
if [ ! -x ${testbin} ]
then
echo "[-] skipping ${testbin} because it isn't executable"
continue
fi
valgrind -q ./${testbin} -n -q
done

View File

@ -3,9 +3,9 @@
set -eu
source /etc/lsb-release
SUDO="sudo"
USE_CMAKE_RC="${USE_CMAKE_RC:-}"
DISTRIB=${DISTRIB:-jammy}
preinstall () {
echo "[+] preparing to install"
@ -25,7 +25,7 @@ do_install () {
wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | gpg --dearmor - | $SUDO tee /usr/share/keyrings/kitware-archive-keyring.gpg >/dev/null
echo "[+] adding repo to sources.list.d"
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ${DISTRIB_CODENAME} main" | \
echo "deb [signed-by=/usr/share/keyrings/kitware-archive-keyring.gpg] https://apt.kitware.com/ubuntu/ ${DISTRIB} main" | \
$SUDO tee /etc/apt/sources.list.d/kitware.list >/dev/null
$SUDO apt-get -y update

View File

@ -54,7 +54,8 @@ install_debianesque () {
fi
echo "[+] installing tools"
sudo $SUDO apt-get $APTARGS install git clang scdoc python3-pip doxygen graphviz
sudo $SUDO apt-get $APTARGS install git clang scdoc \
python3-pip doxygen graphviz valgrind
}
install_alpine () {
@ -68,7 +69,7 @@ install_alpine () {
echo "[+] installing development tooling"
$APK_ADD clang clang-extra-tools cmake cppcheck doxygen g++ git \
graphviz make scdoc
graphviz make scdoc valgrind
}
install_redhat () {
@ -84,7 +85,8 @@ install_redhat () {
# install everything in one shot.
$DNF_INSTALL ca-certificates gzip openssh tar \
clang clang-tools-extra cmake cppcheck doxygen \
gcc-c++ git graphviz libstdc++-devel make scdoc
gcc-c++ git graphviz libstdc++-devel make scdoc \
valgrind
}
install_unsupported () {

0
is-current-tag.sh Normal file → Executable file
View File