[svn r610] Changed some INCLUDES in the test scripts, added another test case.
1.1 --- a/gmyth/tests/Makefile.am Fri Apr 27 19:39:11 2007 +0100
1.2 +++ b/gmyth/tests/Makefile.am Mon Apr 30 16:04:20 2007 +0100
1.3 @@ -1,14 +1,14 @@
1.4 -INCLUDES = -I$(top_srcdir)/src -I$(top_builddir)/src
1.5 -
1.6 LDADD = \
1.7 $(top_srcdir)/src/.libs/libgmyth.la
1.8
1.9 -LDFLAGS = \
1.10 +AM_LDFLAGS = \
1.11 @GLIB_LIBS@ @GOBJECT_LIBS@ @GTHREAD_LIBS@ @LIBCURL_LIBS@
1.12
1.13 INCLUDES = \
1.14 -I$(top_srcdir) \
1.15 + -I$(top_builddir) \
1.16 -I$(top_srcdir)/src \
1.17 + -I$(top_builddir)/src \
1.18 $(MYSQL_CFLAGS) \
1.19 $(GLIB_CFLAGS) \
1.20 $(GOBJECT_CFLAGS) \
1.21 @@ -25,7 +25,8 @@
1.22 gmyth_test_vlc \
1.23 gmyth_test_livetv \
1.24 gmyth_test_http \
1.25 - gmyth_test_filetransfer
1.26 + gmyth_test_filetransfer \
1.27 + gmyth_test_filelocal
1.28
1.29 TESTS = \
1.30 test \
1.31 @@ -39,6 +40,7 @@
1.32 test_livetv.py \
1.33 test_http.py \
1.34 test_filetransfer.py \
1.35 + test_filelocal.py \
1.36 coverage.py
1.37
1.38 TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir)
1.39 @@ -73,3 +75,6 @@
1.40 gmyth_test_filetransfer_SOURCES = \
1.41 gmyth_test_filetransfer.c
1.42
1.43 +gmyth_test_filelocal_SOURCES = \
1.44 + gmyth_test_filelocal.c
1.45 +
2.1 --- a/gmyth/tests/coverage.py Fri Apr 27 19:39:11 2007 +0100
2.2 +++ b/gmyth/tests/coverage.py Mon Apr 30 16:04:20 2007 +0100
2.3 @@ -9,6 +9,7 @@
2.4 def build_dir(exe):
2.5 t = get_gcda(exe)
2.6 a = re.search("(/.*)/tests/*" ,t)
2.7 + print "Tests build directory - %s" % a.groups()[0]
2.8 return a.groups()[0]
2.9
2.10 def gen_cov_info(build_dir):
3.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
3.2 +++ b/gmyth/tests/gmyth_test_filelocal.c Mon Apr 30 16:04:20 2007 +0100
3.3 @@ -0,0 +1,91 @@
3.4 +#include <glib-object.h>
3.5 +
3.6 +#include "common.h"
3.7 +
3.8 +#include "gmyth_uri.h"
3.9 +#include "gmyth_backendinfo.h"
3.10 +#include "gmyth_file.h"
3.11 +#include "gmyth_file_local.h"
3.12 +#include "gmyth_common.h"
3.13 +
3.14 +#define URI_FILE_LOCAL_DEFAULT "myth://192.168.3.165:6543/"
3.15 +
3.16 +static gboolean
3.17 +test_file_local_setup( gchar *uri ) {
3.18 + GMythFileLocal *file = NULL;
3.19 + gboolean ret = TRUE;
3.20 +
3.21 + if ( NULL == uri)
3.22 + uri = g_strdup( URI_FILE_LOCAL_DEFAULT );
3.23 +
3.24 + GMythURI *gmyth_uri = gmyth_uri_new_with_value( uri);
3.25 +
3.26 + GMythBackendInfo* backend_info = gmyth_backend_info_new_with_uri(uri);
3.27 +
3.28 + /* Check if the file is local to this specific client renderer, and tries to open
3.29 + * a local connection
3.30 + */
3.31 + if ( gmyth_uri_is_local_file(gmyth_uri)) {
3.32 + g_debug( "Opening local file connection to download...");
3.33 + file = gmyth_file_local_new(backend_info);
3.34 + ret = gmyth_file_local_open( file );
3.35 + } else {
3.36 + g_debug("FileLocal object specified is not local to the current machine!");
3.37 + ret = FALSE;
3.38 + goto init_failed;
3.39 + }
3.40 +
3.41 + if (NULL == file) {
3.42 + g_debug("File is NULL");
3.43 + ret = FALSE;
3.44 + goto init_failed;
3.45 + }
3.46 +
3.47 + g_debug( "uri = %s", uri);
3.48 +
3.49 + if (ret == FALSE) {
3.50 + g_debug("MythTV FileLocal request failed when setting up socket connection!");
3.51 + goto init_failed;
3.52 + }
3.53 +
3.54 + g_debug( "MythTV FileLocal filesize = %lld",
3.55 + gmyth_file_get_filesize( GMYTH_FILE(file) ) );
3.56 +
3.57 + init_failed:
3.58 +
3.59 + if ( file != NULL)
3.60 + g_object_unref(file);
3.61 +
3.62 + if ( gmyth_uri != NULL)
3.63 + g_object_unref( gmyth_uri);
3.64 +
3.65 + if ( backend_info != NULL)
3.66 + g_object_unref( backend_info);
3.67 +
3.68 + return ret;
3.69 +
3.70 +}
3.71 +
3.72 +gint
3.73 +main(gint args, const gchar **argv) {
3.74 + gboolean ret = FALSE;
3.75 +
3.76 + g_type_init();
3.77 +
3.78 + g_thread_init(NULL);
3.79 +
3.80 + fprintf(stdout, SYNC_STRING);
3.81 + fflush(NULL);
3.82 + getchar();
3.83 +
3.84 + if ( args > 1)
3.85 + ret = test_file_local_setup( argv[1]);
3.86 +
3.87 + if ( !ret)
3.88 + g_debug("Error when running FileLocal setup test script!");
3.89 + else
3.90 + g_debug("FileLocal setup test script finished with success.");
3.91 +
3.92 + return (0);
3.93 +}
3.94 +
4.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
4.2 +++ b/gmyth/tests/test_filelocal.py Mon Apr 30 16:04:20 2007 +0100
4.3 @@ -0,0 +1,10 @@
4.4 +#!/usr/bin/python
4.5 +
4.6 +#doc: test gmyth_file_local_* methods
4.7 +
4.8 +from testing_tools import start, finish
4.9 +import sys
4.10 +
4.11 +p = start('gmyth_test_filelocal', ['myth://192.168.3.165:6543/1000_20070330144500.nuv'])
4.12 +
4.13 +sys.exit(finish(p))