Skip to content

Commit

Permalink
Source tree changes
Browse files Browse the repository at this point in the history
Separate test source to tests directory and change library source
directory from iphb to src. Install test binaries under /opt/tests.

[source] Separate test code to own directory

Signed-off-by: Matti Kosola <matti.kosola@jollamobile.com>
  • Loading branch information
Matti Kosola committed May 30, 2013
1 parent 9e3fba1 commit 31b57ff
Show file tree
Hide file tree
Showing 15 changed files with 52 additions and 35 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Expand Up @@ -44,9 +44,9 @@ debian/libiphb0.postinst.debhelper
debian/libiphb0.postrm.debhelper
debian/tmp/

iphbd/hbtest
iphbd/hbtest2
iphbd/libiphb.pc
iphbd/libiphb-uninstalled.pc
tests/hbtest
tests/hbtest2
src/libiphb.pc
src/libiphb-uninstalled.pc

m4/
2 changes: 1 addition & 1 deletion Makefile.am
@@ -1 +1 @@
SUBDIRS = iphbd
SUBDIRS = src tests
9 changes: 5 additions & 4 deletions configure.ac
Expand Up @@ -4,7 +4,7 @@ AC_INIT(libiphb, 1.0.0)
AM_INIT_AUTOMAKE

AC_PREREQ([2.61])
AC_CONFIG_SRCDIR([iphbd/libiphb.c])
AC_CONFIG_SRCDIR([src/libiphb.c])

# NOTE: Must the LT version must be changed when code is released:
# - If interfaces changed/added/removed: lt_current++, lt_rev=0
Expand Down Expand Up @@ -60,8 +60,9 @@ AC_CHECK_FUNCS([inet_ntoa memset select socket strerror])

# Create files
AC_CONFIG_FILES([Makefile
iphbd/Makefile
iphbd/libiphb-uninstalled.pc
iphbd/libiphb.pc])
src/Makefile
src/libiphb-uninstalled.pc
src/libiphb.pc
tests/Makefile])

AC_OUTPUT
20 changes: 10 additions & 10 deletions rpm/libiphb.spec
Expand Up @@ -13,7 +13,7 @@ Version: 1.0.0
Release: 0
Group: System/System Control
License: LGPLv2+
URL: http://meego.gitorious.org/meego-middleware/libiphb
URL: http://github.com/nemomobile/libiphb
Source0: %{name}-%{version}.tar.bz2
Source100: libiphb.yaml
Requires(post): /sbin/ldconfig
Expand All @@ -34,13 +34,13 @@ Requires: %{name} = %{version}-%{release}
This package contains C headers for the IP Heartbeat API.


%package test
Summary: Test tool for IP Heartbeat service
%package tests
Summary: Tests package for IP Heartbeat service
Group: Development/Tools
Requires: %{name} = %{version}-%{release}

%description test
Command line utility to test IP Heartbeat functionality.
%description tests
Tests package to test IP Heartbeat functionality.


%prep
Expand Down Expand Up @@ -93,10 +93,10 @@ rm -rf %{buildroot}
# >> files devel
# << files devel

%files test
%files tests
%defattr(-,root,root,-)
%{_bindir}/hbtest
%{_bindir}/hbtest2
/opt/tests/%{name}-tests/bin/hbtest
/opt/tests/%{name}-tests/bin/hbtest2
%doc COPYING
# >> files test
# << files test
# >> files tests
# << files tests
12 changes: 6 additions & 6 deletions rpm/libiphb.yaml
Expand Up @@ -4,7 +4,7 @@ Version: 1.0.0
Release: 0
Group: System/System Control
License: LGPLv2+
URL: http://meego.gitorious.org/meego-middleware/libiphb
URL: http://github.com/nemomobile/libiphb
Description: |
This package contains C API for using IP Heartbeat service.
Expand Down Expand Up @@ -32,12 +32,12 @@ SubPackages:
- "%{_libdir}/libiphb.so"
- "%{_libdir}/pkgconfig/libiphb.pc"
- "%doc COPYING"
- Name: test
- Name: tests
Group: Development/Tools
Summary: Test tool for IP Heartbeat service
Summary: Tests package for IP Heartbeat service
Description: |
Command line utility to test IP Heartbeat functionality.
Tests package to test IP Heartbeat functionality.
Files:
- "%{_bindir}/hbtest"
- "%{_bindir}/hbtest2"
- "/opt/tests/%{name}-tests/bin/hbtest"
- "/opt/tests/%{name}-tests/bin/hbtest2"
- "%doc COPYING"
8 changes: 0 additions & 8 deletions iphbd/Makefile.am → src/Makefile.am
Expand Up @@ -15,16 +15,8 @@ iphbdincludedir = @includedir@/iphbd
#
# Build targets
#
bin_PROGRAMS = hbtest hbtest2
lib_LTLIBRARIES = libiphb.la

hbtest_SOURCES = hbtest.c
hbtest_LDADD = libiphb.la


hbtest2_SOURCES = hbtest2.c
hbtest2_LDADD = libiphb.la

libiphb_la_SOURCES = libiphb.c
libiphb_la_LDFLAGS = $(AM_LDFLAGS) -shared -version-info $(IPHB_LT_VERSION)

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
24 changes: 24 additions & 0 deletions tests/Makefile.am
@@ -0,0 +1,24 @@
#
# Generic options
#
AM_CFLAGS = -Wall -Wmissing-prototypes -std=c99 -Os -g -fPIC
AM_CPPFLAGS = -D_GNU_SOURCE
AM_LDFLAGS = -g -lrt -Wl,--as-needed

ACLOCAL_AMFLAGS = -I m4

#
# Additional dirs
#
testbindir = /opt/tests/libiphb-tests/bin

#
# Build targets
#
testbin_PROGRAMS = hbtest hbtest2

hbtest_SOURCES = hbtest.c
hbtest_LDADD = ../src/libiphb.la

hbtest2_SOURCES = hbtest2.c
hbtest2_LDADD = ../src/libiphb.la
2 changes: 1 addition & 1 deletion iphbd/hbtest.c → tests/hbtest.c
Expand Up @@ -62,7 +62,7 @@
#include <arpa/inet.h>
#include <netinet/tcp.h>

#include "libiphb.h"
#include "../src/libiphb.h"

static volatile int run = 1;

Expand Down
2 changes: 1 addition & 1 deletion iphbd/hbtest2.c → tests/hbtest2.c
Expand Up @@ -45,7 +45,7 @@
#include <arpa/inet.h>
#include <netinet/tcp.h>

#include "libiphb.h"
#include "../src/libiphb.h"

static volatile int run = 1;

Expand Down

0 comments on commit 31b57ff

Please sign in to comment.