[svn r405] Added check target to the Makefile.am tool; now, you can type 'make check' to run some of the test scripts.
1.1 --- a/gmyth/Makefile.am Wed Mar 07 22:15:15 2007 +0000
1.2 +++ b/gmyth/Makefile.am Wed Mar 07 23:28:36 2007 +0000
1.3 @@ -1,4 +1,4 @@
1.4 -SUBDIRS= src
1.5 +SUBDIRS= src tests
1.6
1.7 ### all of the standard pc files we need to generate
1.8 #pcfiles = gmyth-@GMYTH_MAJORMINOR@.pc
2.1 --- a/gmyth/tests/Makefile.am Wed Mar 07 22:15:15 2007 +0000
2.2 +++ b/gmyth/tests/Makefile.am Wed Mar 07 23:28:36 2007 +0000
2.3 @@ -1,18 +1,38 @@
2.4 -noinst_PROGRAMS = \
2.5 - test
2.6 +LDADD = \
2.7 + $(MYSQL_LIBS) \
2.8 + $(GLIB_LIBS) \
2.9 + $(GOBJECT_LIBS) \
2.10 + $(GTK_LIBS) \
2.11 + $(LIBCURL_LIBS) \
2.12 + $(top_srcdir)/src/.libs/libgmyth.la
2.13 +
2.14 +INCLUDES = \
2.15 + -I$(top_srcdir) \
2.16 + -I$(top_srcdir)/src \
2.17 + $(MYSQL_CFLAGS) \
2.18 + $(GLIB_CFLAGS) \
2.19 + $(GOBJECT_CFLAGS) \
2.20 + $(GTK_CFLAGS) \
2.21 + $(LIBCURL_CFLAGS)
2.22 +
2.23 +check_PROGRAMS = \
2.24 + test \
2.25 + gmyth_test_connection \
2.26 + gmyth_test_http
2.27
2.28 TESTS = \
2.29 - test
2.30 + test \
2.31 + gmyth_test_connection \
2.32 + gmyth_test_http
2.33 +
2.34 +TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir)
2.35
2.36 test_SOURCES = \
2.37 main.c
2.38
2.39 -test_LDADD = \
2.40 - $(MYSQL_LIBS) \
2.41 - $(top_builddir)/src/libgmyth.la
2.42 +gmyth_test_connection_SOURCES = \
2.43 + gmyth_test_connection.c
2.44
2.45 -AM_CPPFLAGS = \
2.46 - -I$(top_srcdir) \
2.47 - -I$(top_srcdir)/src \
2.48 - $(MYSQL_CFLAGS) \
2.49 - $(GLIB_CFLAGS)
2.50 +gmyth_test_http_SOURCES = \
2.51 + gmyth_test_http.c
2.52 +
3.1 --- a/gmyth/tests/gmyth_test_http.c Wed Mar 07 22:15:15 2007 +0000
3.2 +++ b/gmyth/tests/gmyth_test_http.c Wed Mar 07 23:28:36 2007 +0000
3.3 @@ -11,7 +11,7 @@
3.4
3.5 backend_info = gmyth_backend_info_new ();
3.6
3.7 - gmyth_backend_info_set_hostname (backend_info, "192.168.3.166");
3.8 + gmyth_backend_info_set_hostname (backend_info, "192.168.3.165");
3.9 gmyth_backend_info_set_port (backend_info, 6543);
3.10 gmyth_backend_info_set_status_port (backend_info, 6544);
3.11
4.1 --- a/gmyth/tests/main.c Wed Mar 07 22:15:15 2007 +0000
4.2 +++ b/gmyth/tests/main.c Wed Mar 07 23:28:36 2007 +0000
4.3 @@ -1,5 +1,6 @@
4.4 #include <glib-object.h>
4.5 -#include "gmyth.h"
4.6 +#include <glib.h>
4.7 +#include <gmyth/gmyth.h>
4.8
4.9 int
4.10 main (int args, const char **argv)
4.11 @@ -9,7 +10,7 @@
4.12 gboolean res;
4.13 GMythBackendInfo *backend_info;
4.14 g_type_init ();
4.15 - g_thread_init (NULL);
4.16 + // g_thread_init (NULL);
4.17
4.18 backend_info = gmyth_backend_info_new ();
4.19 gmyth_uri = gmyth_uri_new_with_value (uri);
4.20 @@ -22,9 +23,9 @@
4.21 g_debug ("file not exists");
4.22 return -1;
4.23 }
4.24 - GMythFileTransfer *file_transfer = gmyth_file_transfer_new ();
4.25 + GMythFileTransfer *file_transfer = gmyth_file_transfer_new (backend_info);
4.26 GString *hostname = g_string_new (uri);
4.27 - res = gmyth_file_transfer_open (file_transfer, hostname);
4.28 + res = gmyth_file_transfer_open (file_transfer, uri);
4.29 if (res == FALSE) {
4.30 g_debug ("Fail to open server");
4.31 return -1;