# HG changeset patch # User rosfran # Date 1173310116 0 # Node ID 8712835e34cc6833710fe0bfacecbc25bc5ee84f # Parent 918644a591067194d8cbf29e0b046a34fa2946e1 [svn r405] Added check target to the Makefile.am tool; now, you can type 'make check' to run some of the test scripts. diff -r 918644a59106 -r 8712835e34cc gmyth/Makefile.am --- a/gmyth/Makefile.am Wed Mar 07 22:15:15 2007 +0000 +++ b/gmyth/Makefile.am Wed Mar 07 23:28:36 2007 +0000 @@ -1,4 +1,4 @@ -SUBDIRS= src +SUBDIRS= src tests ### all of the standard pc files we need to generate #pcfiles = gmyth-@GMYTH_MAJORMINOR@.pc diff -r 918644a59106 -r 8712835e34cc gmyth/tests/Makefile.am --- a/gmyth/tests/Makefile.am Wed Mar 07 22:15:15 2007 +0000 +++ b/gmyth/tests/Makefile.am Wed Mar 07 23:28:36 2007 +0000 @@ -1,18 +1,38 @@ -noinst_PROGRAMS = \ - test +LDADD = \ + $(MYSQL_LIBS) \ + $(GLIB_LIBS) \ + $(GOBJECT_LIBS) \ + $(GTK_LIBS) \ + $(LIBCURL_LIBS) \ + $(top_srcdir)/src/.libs/libgmyth.la + +INCLUDES = \ + -I$(top_srcdir) \ + -I$(top_srcdir)/src \ + $(MYSQL_CFLAGS) \ + $(GLIB_CFLAGS) \ + $(GOBJECT_CFLAGS) \ + $(GTK_CFLAGS) \ + $(LIBCURL_CFLAGS) + +check_PROGRAMS = \ + test \ + gmyth_test_connection \ + gmyth_test_http TESTS = \ - test + test \ + gmyth_test_connection \ + gmyth_test_http + +TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir) test_SOURCES = \ main.c -test_LDADD = \ - $(MYSQL_LIBS) \ - $(top_builddir)/src/libgmyth.la +gmyth_test_connection_SOURCES = \ + gmyth_test_connection.c -AM_CPPFLAGS = \ - -I$(top_srcdir) \ - -I$(top_srcdir)/src \ - $(MYSQL_CFLAGS) \ - $(GLIB_CFLAGS) +gmyth_test_http_SOURCES = \ + gmyth_test_http.c + diff -r 918644a59106 -r 8712835e34cc gmyth/tests/gmyth_test_http.c --- a/gmyth/tests/gmyth_test_http.c Wed Mar 07 22:15:15 2007 +0000 +++ b/gmyth/tests/gmyth_test_http.c Wed Mar 07 23:28:36 2007 +0000 @@ -11,7 +11,7 @@ backend_info = gmyth_backend_info_new (); - gmyth_backend_info_set_hostname (backend_info, "192.168.3.166"); + gmyth_backend_info_set_hostname (backend_info, "192.168.3.165"); gmyth_backend_info_set_port (backend_info, 6543); gmyth_backend_info_set_status_port (backend_info, 6544); diff -r 918644a59106 -r 8712835e34cc gmyth/tests/main.c --- a/gmyth/tests/main.c Wed Mar 07 22:15:15 2007 +0000 +++ b/gmyth/tests/main.c Wed Mar 07 23:28:36 2007 +0000 @@ -1,5 +1,6 @@ #include -#include "gmyth.h" +#include +#include int main (int args, const char **argv) @@ -9,7 +10,7 @@ gboolean res; GMythBackendInfo *backend_info; g_type_init (); - g_thread_init (NULL); + // g_thread_init (NULL); backend_info = gmyth_backend_info_new (); gmyth_uri = gmyth_uri_new_with_value (uri); @@ -22,9 +23,9 @@ g_debug ("file not exists"); return -1; } - GMythFileTransfer *file_transfer = gmyth_file_transfer_new (); + GMythFileTransfer *file_transfer = gmyth_file_transfer_new (backend_info); GString *hostname = g_string_new (uri); - res = gmyth_file_transfer_open (file_transfer, hostname); + res = gmyth_file_transfer_open (file_transfer, uri); if (res == FALSE) { g_debug ("Fail to open server"); return -1;