Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build unit tests only when --enable-unittests is passed #701

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ stages:

- bash: |
export CFLAGS="-ggdb3 -O2"
./autogen.sh --prefix=/usr --enable-warnaserror
./autogen.sh --prefix=/usr --enable-warnaserror --enable-unittests
make -j4
sudo make install
displayName: 'Build and Install libgdiplus'
Expand Down Expand Up @@ -87,7 +87,7 @@ stages:
- bash: |
export CFLAGS="-m64 -arch x86_64 -mmacosx-version-min=10.9"
export LDFLAGS="-m64 -arch x86_64"
./autogen.sh --prefix=/tmp/libgdiplus-dev --enable-warnaserror --without-x11 --host=x86_64-apple-darwin13.0.0 --build=x86_64-apple-darwin13.0.0
./autogen.sh --prefix=/tmp/libgdiplus-dev --enable-warnaserror --enable-unittests --without-x11 --host=x86_64-apple-darwin13.0.0 --build=x86_64-apple-darwin13.0.0
make -j4
make install
displayName: 'Build and Install libgdiplus'
Expand Down
8 changes: 6 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
ACLOCAL_AMFLAGS = -I m4

SUBDIRS = src tests
DIST_SUBDIRS = src tests
if BUILD_UNIT_TESTS
SUBDIRS_TESTS = tests
endif

SUBDIRS = src $(SUBDIRS_TESTS)
DIST_SUBDIRS = src $(SUBDIRS_TESTS)

pkgconfigdir = $(libdir)/pkgconfig

Expand Down
4 changes: 4 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ AC_ARG_WITH(pango, [ --with-pango use Pango to measure and draw text

GDIPLUS_CFLAGS="$GDIPLUS_CFLAGS -Wall -Wextra -Wno-unused-parameter -Wno-sign-compare -std=gnu11"

AC_ARG_ENABLE(unittests, AS_HELP_STRING([--enable-unittests],[Enable building unit tests.]),[unittests=yes],[unittests=no])

AM_CONDITIONAL([BUILD_UNIT_TESTS], [test x$unittests = xyes])

AC_ARG_ENABLE(warnaserror, AS_HELP_STRING([--enable-warnaserror],[Enable treating warnings as errors.]),[warnaserror=yes],[warnaserror=no])

if test $warnaserror = "yes"; then
Expand Down