mirror of
https://gitlab.freedesktop.org/dbus/dbus.git
synced 2026-01-04 06:10:16 +01:00
2003-03-13 Havoc Pennington <hp@pobox.com>
* bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c: set up a test framework as for the library
This commit is contained in:
parent
6ecc14ffab
commit
d65b73884c
7 changed files with 130 additions and 4 deletions
|
|
@ -1,3 +1,8 @@
|
|||
2003-03-13 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
* bus/test.c, bus/test.h, bus/Makefile.am, bus/test-main.c:
|
||||
set up a test framework as for the library
|
||||
|
||||
2003-03-12 Havoc Pennington <hp@pobox.com>
|
||||
|
||||
Throughout: purge global variables, introduce BusActivation,
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@ libdbus_daemon_la_SOURCES= \
|
|||
loop.h \
|
||||
services.c \
|
||||
services.h \
|
||||
test.c \
|
||||
test.h \
|
||||
utils.c \
|
||||
utils.h
|
||||
|
||||
|
|
@ -40,3 +42,26 @@ dbus_daemon_1_LDADD= \
|
|||
$(DBUS_BUS_LIBS) \
|
||||
$(top_builddir)/bus/libdbus-daemon.la \
|
||||
$(top_builddir)/dbus/libdbus-1.la
|
||||
|
||||
## note that TESTS has special meaning (stuff to use in make check)
|
||||
## so if adding tests not to be run in make check, don't add them to
|
||||
## TESTS
|
||||
if DBUS_BUILD_TESTS
|
||||
TESTS_ENVIRONMENT=DBUS_TEST_DATA=$(top_srcdir)/test/data
|
||||
TESTS=bus-test
|
||||
else
|
||||
TESTS=
|
||||
endif
|
||||
|
||||
## we use noinst_PROGRAMS not check_PROGRAMS so that we build
|
||||
## even when not doing "make check"
|
||||
noinst_PROGRAMS=$(TESTS)
|
||||
|
||||
bus_test_SOURCES= \
|
||||
test-main.c
|
||||
|
||||
bus_test_LDADD= $(top_builddir)/dbus/libdbus-convenience.la libdbus-daemon.la
|
||||
|
||||
## mop up the gcov files
|
||||
clean-local:
|
||||
/bin/rm *.bb *.bbg *.da *.gcov || true
|
||||
|
|
|
|||
|
|
@ -24,6 +24,8 @@
|
|||
#ifndef BUS_BUS_H
|
||||
#define BUS_BUS_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
#include <dbus/dbus-string.h>
|
||||
|
||||
|
|
|
|||
37
bus/test-main.c
Normal file
37
bus/test-main.c
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
/* -*- mode: C; c-file-style: "gnu" -*- */
|
||||
/* test-main.c main() for make check
|
||||
*
|
||||
* Copyright (C) 2003 Red Hat, Inc.
|
||||
*
|
||||
* Licensed under the Academic Free License version 1.2
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#include "test.h"
|
||||
|
||||
int
|
||||
main (int argc, char **argv)
|
||||
{
|
||||
#ifdef DBUS_BUILD_TESTS
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
#else /* DBUS_BUILD_TESTS */
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
23
bus/test.c
Normal file
23
bus/test.c
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
/* -*- mode: C; c-file-style: "gnu" -*- */
|
||||
/* test.c unit test routines
|
||||
*
|
||||
* Copyright (C) 2003 Red Hat, Inc.
|
||||
*
|
||||
* Licensed under the Academic Free License version 1.2
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
38
bus/test.h
Normal file
38
bus/test.h
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
/* -*- mode: C; c-file-style: "gnu" -*- */
|
||||
/* test.h unit test routines
|
||||
*
|
||||
* Copyright (C) 2003 Red Hat, Inc.
|
||||
*
|
||||
* Licensed under the Academic Free License version 1.2
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*
|
||||
*/
|
||||
|
||||
#ifndef BUS_TEST_H
|
||||
#define BUS_TEST_H
|
||||
|
||||
#include <config.h>
|
||||
|
||||
#ifdef DBUS_BUILD_TESTS
|
||||
|
||||
#include <dbus/dbus.h>
|
||||
#include <dbus/dbus-string.h>
|
||||
|
||||
dbus_bool_t bus_test_foo (const DBusString *test_data_dir);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* BUS_TEST_H */
|
||||
|
|
@ -101,10 +101,6 @@ libdbus_1_la_LIBADD= $(DBUS_CLIENT_LIBS) libdbus-convenience.la
|
|||
## convention for internal symbols)
|
||||
libdbus_1_la_LDFLAGS= -export-symbols-regex "^[^_].*"
|
||||
|
||||
## FIXME it would be less annoying when hacking if we didn't have
|
||||
## to relink these test binaries, so moving them to the test/*
|
||||
## subdir would be nice.
|
||||
|
||||
## note that TESTS has special meaning (stuff to use in make check)
|
||||
## so if adding tests not to be run in make check, don't add them to
|
||||
## TESTS
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue