Skip to content

Commit

Permalink
TEST/BUILD: Fix release build
Browse files Browse the repository at this point in the history
  • Loading branch information
yosefe committed Oct 30, 2014
1 parent dbcbed3 commit 8f99ccc
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 14 deletions.
6 changes: 5 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@

ACLOCAL_AMFLAGS = -I config/m4

SUBDIRS = src/ucs src/uct test/gtest
SUBDIRS = src/ucs src/uct

if HAVE_GTEST
SUBDIRS += test/gtest
endif

EXTRA_DIST =
EXTRA_DIST += m4/gtest.m4
Expand Down
33 changes: 20 additions & 13 deletions src/ucs/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,13 @@

AUTOMAKE_OPTIONS = nostdinc # avoid collision with built-in debug.h
AM_CPPFLAGS = -I$(top_builddir) -I$(abs_top_srcdir)/src
lib_LTLIBRARIES = libucs.la libucstest.la
bin_PROGRAMS = ucs_stats_parser
lib_LTLIBRARIES = libucs.la
bin_PROGRAMS =

libucs_la_LDFLAGS = -ldl -version-info $(SOVERSION)
libucs_la_LIBADD = $(LIBM)
libucs_ladir = $(includedir)

libucstest_la_LDFLAGS = -ldl -version-info $(SOVERSION)
libucstest_la_LIBADD = libucs.la
libucstest_ladir = $(includedir)

noinst_HEADERS = \
config/global_opts.h \
config/parser.h \
Expand Down Expand Up @@ -64,10 +60,7 @@ libucs_la_SOURCES = \
debug/instrument.c \
debug/log.c \
debug/memtrack.c \
stats/client_server.c \
stats/serialization.c \
stats/stats.c \
stats/libstats.c \
sys/math.c \
sys/sys.c \
time/time.c \
Expand All @@ -77,13 +70,27 @@ libucs_la_SOURCES = \
type/component.c \
type/status.c

libucstest_la_SOURCES = \
if HAVE_STATS
libucs_la_SOURCES += \
stats/client_server.c \
stats/serialization.c \
stats/libstats.c

bin_PROGRAMS += ucs_stats_parser
ucs_stats_parser_LDADD = libucs.la
ucs_stats_parser_SOURCES = stats/stats_parser.c
endif

if HAVE_GTEST
lib_LTLIBRARIES += libucstest.la
libucstest_la_LDFLAGS = -ldl -version-info $(SOVERSION)
libucstest_la_LIBADD = libucs.la
libucstest_ladir = $(includedir)
libucstest_la_SOURCES = \
gtest/main.cc \
gtest/test_helpers.cc \
gtest/test.cc

ucs_stats_parser_LDADD = libucs.la
ucs_stats_parser_SOURCES = stats/stats_parser.c
endif


#TODO stats/stats_dump.c
Expand Down
1 change: 1 addition & 0 deletions src/ucs/gtest/test_helpers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#include "test_helpers.h"

extern "C" {
#include <ucs/sys/math.h>
#include <ucs/sys/sys.h>
}

Expand Down
23 changes: 23 additions & 0 deletions src/ucs/stats/stats.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
#include <sys/ioctl.h>


#if ENABLE_STATS

enum {
UCS_STATS_FLAG_ON_EXIT = UCS_BIT(0),
UCS_STATS_FLAG_ON_TIMER = UCS_BIT(1),
Expand Down Expand Up @@ -442,3 +444,24 @@ int ucs_stats_is_active()
{
return ucs_stats_context.flags & (UCS_STATS_FLAG_SOCKET|UCS_STATS_FLAG_STREAM);
}

#else

void mxm_stats_init()
{
}

void mxm_stats_cleanup()
{
}

void mxm_stats_dump()
{
}

int mxm_stats_is_active()
{
return 0;
}

#endif

0 comments on commit 8f99ccc

Please sign in to comment.