Skip to content

Commit

Permalink
update debian packaging to enable tests
Browse files Browse the repository at this point in the history
  • Loading branch information
irfanHaslanded authored and michalvasko committed Jul 29, 2024
1 parent 28acd30 commit d6e117f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ elseif("${BUILD_TYPE_UPPER}" STREQUAL "DEBUG")
set(CMAKE_C_FLAGS "-g -O0 ${CMAKE_C_FLAGS}")
elseif("${BUILD_TYPE_UPPER}" STREQUAL "RELWITHDEBINFO")
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Build Type" FORCE)
set(CMAKE_C_FLAGS "-DNDEBUG -g -O2 ${CMAKE_C_FLAGS}")
elseif("${BUILD_TYPE_UPPER}" STREQUAL "RELWITHDEBUG")
set(CMAKE_BUILD_TYPE "RelWithDebug" CACHE STRING "Build Type" FORCE)
elseif("${BUILD_TYPE_UPPER}" STREQUAL "ABICHECK")
Expand Down
5 changes: 4 additions & 1 deletion distro/pkg/deb/control
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@ Build-Depends: cmake,
debhelper (>= 10),
libyang-dev,
libsystemd-dev,
pkg-config
pkg-config,
libcmocka-dev,
valgrind

Vcs-Browser: https://github.com/sysrepo/sysrepo/tree/master
Vcs-Git: https://github.com/sysrepo/sysrepo.git

Expand Down
13 changes: 11 additions & 2 deletions distro/pkg/deb/rules
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,21 @@ export DEB_BUILD_MAINT_OPTIONS = hardening=+all

include /usr/share/dpkg/default.mk

# determine number of processors to enable parallel tests
NPROCS:=$(shell grep -c ^processor /proc/cpuinfo)

%:
dh $@
dh $@ -j

override_dh_auto_configure:
dh_auto_configure -- \
-DCMAKE_BUILD_TYPE:String="Release" \
-DCMAKE_BUILD_TYPE:String="RelWithDebInfo" \
-DSYSREPO_UMASK=007 \
-DSYSREPO_GROUP=sysrepo \
-DNACM_SRMON_DATA_PERM=660

override_dh_auto_test:
ifeq ($(filter nocheck,$(DEB_BUILD_OPTIONS)),)
make -C obj-$(DEB_HOST_GNU_TYPE) test ARGS=' -j $(NPROCS) -V'
make -C obj-$(DEB_HOST_GNU_TYPE) test_clean
endif

0 comments on commit d6e117f

Please sign in to comment.