[svn r624] Allows to use some new arguments in the lcov tool.
1.1 --- a/gmyth/configure.ac Tue May 01 23:02:19 2007 +0100
1.2 +++ b/gmyth/configure.ac Wed May 02 16:11:14 2007 +0100
1.3 @@ -5,7 +5,7 @@
1.4
1.5 AC_INIT([gmyth],[0.3])
1.6
1.7 -dnl AC_CONFIG_SRCDIR([src/mmyth_main.c])
1.8 +AC_CONFIG_SRCDIR([src/gmyth.h])
1.9 AC_CONFIG_HEADER(config.h)
1.10
1.11 dnl when going to/from release please set the nano (fourth number) right !
2.1 --- a/gmyth/src/Makefile.am Tue May 01 23:02:19 2007 +0100
2.2 +++ b/gmyth/src/Makefile.am Wed May 02 16:11:14 2007 +0100
2.3 @@ -97,4 +97,6 @@
2.4 gmyth_file.h \
2.5 gmyth_file_local.h
2.6
2.7 -CLEANFILES = $(BUILT_SOURCES)
2.8 +CLEANFILES = $(BUILT_SOURCES) \
2.9 + *.gcda \
2.10 + *.gcno
3.1 --- a/gmyth/tests/Makefile.am Tue May 01 23:02:19 2007 +0100
3.2 +++ b/gmyth/tests/Makefile.am Wed May 02 16:11:14 2007 +0100
3.3 @@ -26,11 +26,12 @@
3.4 gmyth_test_livetv \
3.5 gmyth_test_http \
3.6 gmyth_test_filetransfer \
3.7 - gmyth_test_filelocal
3.8 + gmyth_test_filelocal \
3.9 + gmyth_test_file_download
3.10
3.11 TESTS = \
3.12 - test \
3.13 relink.py \
3.14 + test_main.py \
3.15 test_connection.py \
3.16 test_epg.py \
3.17 test_recorder.py \
3.18 @@ -41,6 +42,7 @@
3.19 test_http.py \
3.20 test_filetransfer.py \
3.21 test_filelocal.py \
3.22 + test_file_download.py \
3.23 coverage.py
3.24
3.25 TESTS_ENVIRONMENT = top_srcdir=$(top_srcdir)
3.26 @@ -78,3 +80,10 @@
3.27 gmyth_test_filelocal_SOURCES = \
3.28 gmyth_test_filelocal.c
3.29
3.30 +gmyth_test_file_download_SOURCES = \
3.31 + gmyth_test_file_download.c
3.32 +
3.33 +CLEANFILES = $(BUILT_SOURCES) \
3.34 + *.gcda \
3.35 + *.gcno
3.36 +
4.1 --- a/gmyth/tests/README Tue May 01 23:02:19 2007 +0100
4.2 +++ b/gmyth/tests/README Wed May 02 16:11:14 2007 +0100
4.3 @@ -33,7 +33,7 @@
4.4 If the --enable-coverage option is used, the library and test programs
4.5 are compiled with support for generating line coverage
4.6 information. After running the tests, a summary will be available in
4.7 -tests/regression/covere/index.html.
4.8 +tests/coverage/index.html.
4.9
4.10 If --enable-mudflap-debug is used, libmudflap is linked with
4.11 gmyth. Libmudflap will test for and report some common memory
4.12 @@ -157,10 +157,10 @@
4.13 --------------------------------------
4.14 #!/usr/bin/python
4.15
4.16 -from test import start
4.17 +from testing_tools import start
4.18 import sys
4.19
4.20 -p = start('gmyth_test_epg', 2)
4.21 +p = start('gmyth_test_livetv', 2)
4.22 sys.exit(finish(p))
4.23 ----------------------------------
4.24
5.1 --- a/gmyth/tests/coverage.py Tue May 01 23:02:19 2007 +0100
5.2 +++ b/gmyth/tests/coverage.py Wed May 02 16:11:14 2007 +0100
5.3 @@ -8,21 +8,24 @@
5.4
5.5 def build_dir(exe):
5.6 t = get_gcda(exe)
5.7 - a = re.search("(/.*)/tests/*" ,t)
5.8 - print "Tests build directory - %s" % a.groups()[0]
5.9 + a = re.search("(/.*)/tests/.*" ,t)
5.10 + print "GMyth base build directory - %s" % a.groups()[0]
5.11 return a.groups()[0]
5.12
5.13 def gen_cov_info(build_dir):
5.14 if os.path.exists('coverage'):
5.15 shutil.rmtree('coverage')
5.16 os.mkdir('coverage')
5.17 - os.chdir('coverage')
5.18 - base_dir = '../' + os.environ['top_srcdir'] + '/src'
5.19 - os.system('lcov -d ' + build_dir + ' -b ' + base_dir + ' -z')
5.20 - os.system('lcov -d ' + build_dir + ' -b ' + base_dir + ' -c -o gmyth.info')
5.21 - os.system('genhtml gmyth.info')
5.22 + #os.chdir('coverage')
5.23 + #base_dir = '../' + os.environ['top_srcdir'] + '/src'
5.24 + #base_dir = build_dir + '/tests'
5.25 + os.system('lcov -d ' + build_dir + ' -b ../src -z')
5.26 + os.system('lcov -d ' + build_dir + ' -b ../src -c -o gmyth.info')
5.27 + #os.system('lcov -d ' + build_dir + ' -z')
5.28 + #os.system('lcov -d ' + build_dir + ' -c -o gmyth.info')
5.29 + os.system('genhtml -o ./coverage/ gmyth.info')
5.30
5.31 -exe = 'test'
5.32 +exe = 'gmyth_test_connection'
5.33 exe = [ '.libs/' + exe ]
5.34 if is_coverage(exe):
5.35 bdir = build_dir(exe)
6.1 --- a/gmyth/tests/gmyth_test_connection.c Tue May 01 23:02:19 2007 +0100
6.2 +++ b/gmyth/tests/gmyth_test_connection.c Wed May 02 16:11:14 2007 +0100
6.3 @@ -3,10 +3,10 @@
6.4 #include <string.h>
6.5 #include <stdio.h>
6.6
6.7 -#include "gmyth_uri.h"
6.8 -#include "gmyth_backendinfo.h"
6.9 -#include "gmyth_socket.h"
6.10 -#include "gmyth_query.h"
6.11 +#include <gmyth/gmyth_uri.h>
6.12 +#include <gmyth/gmyth_backendinfo.h>
6.13 +#include <gmyth/gmyth_socket.h>
6.14 +#include <gmyth/gmyth_query.h>
6.15
6.16 #include "common.h"
6.17
7.1 --- a/gmyth/tests/gmyth_test_epg.c Tue May 01 23:02:19 2007 +0100
7.2 +++ b/gmyth/tests/gmyth_test_epg.c Wed May 02 16:11:14 2007 +0100
7.3 @@ -1,6 +1,6 @@
7.4
7.5 -#include "gmyth_backendinfo.h"
7.6 -#include "gmyth_epg.h"
7.7 +#include <gmyth/gmyth_backendinfo.h>
7.8 +#include <gmyth/gmyth_epg.h>
7.9
7.10 #include "common.h"
7.11
8.1 --- a/gmyth/tests/gmyth_test_filelocal.c Tue May 01 23:02:19 2007 +0100
8.2 +++ b/gmyth/tests/gmyth_test_filelocal.c Wed May 02 16:11:14 2007 +0100
8.3 @@ -2,11 +2,11 @@
8.4
8.5 #include "common.h"
8.6
8.7 -#include "gmyth_uri.h"
8.8 -#include "gmyth_backendinfo.h"
8.9 -#include "gmyth_file.h"
8.10 -#include "gmyth_file_local.h"
8.11 -#include "gmyth_common.h"
8.12 +#include <gmyth/gmyth_uri.h>
8.13 +#include <gmyth/gmyth_backendinfo.h>
8.14 +#include <gmyth/gmyth_file.h>
8.15 +#include <gmyth/gmyth_file_local.h>
8.16 +#include <gmyth/gmyth_common.h>
8.17
8.18 #define URI_FILE_LOCAL_DEFAULT "myth://192.168.3.165:6543/"
8.19
9.1 --- a/gmyth/tests/gmyth_test_filetransfer.c Tue May 01 23:02:19 2007 +0100
9.2 +++ b/gmyth/tests/gmyth_test_filetransfer.c Wed May 02 16:11:14 2007 +0100
9.3 @@ -2,23 +2,20 @@
9.4
9.5 #include "common.h"
9.6
9.7 -#include "gmyth_uri.h"
9.8 -#include "gmyth_backendinfo.h"
9.9 -#include "gmyth_livetv.h"
9.10 -#include "gmyth_file.h"
9.11 -#include "gmyth_file_transfer.h"
9.12 -#include "gmyth_file_local.h"
9.13 -#include "gmyth_common.h"
9.14 +#include <gmyth/gmyth_uri.h>
9.15 +#include <gmyth/gmyth_backendinfo.h>
9.16 +#include <gmyth/gmyth_livetv.h>
9.17 +#include <gmyth/gmyth_file.h>
9.18 +#include <gmyth/gmyth_file_transfer.h>
9.19 +#include <gmyth/gmyth_file_local.h>
9.20 +#include <gmyth/gmyth_common.h>
9.21
9.22 #define URI_FILE_TRANSFER_DEFAULT "myth://192.168.3.165:6543/"
9.23
9.24 static gboolean
9.25 test_file_transfer_setup( gchar *uri ) {
9.26 - GMythLiveTV *livetv = NULL;
9.27 GMythFile *file = NULL;
9.28 - gchar *channel_name = NULL;
9.29 gboolean ret = TRUE;
9.30 - gboolean live_tv = FALSE;
9.31
9.32 if ( NULL == uri)
9.33 uri = g_strdup( URI_FILE_TRANSFER_DEFAULT );
9.34 @@ -56,8 +53,7 @@
9.35 g_debug( "MythTV FileTransfer filesize = %lld",
9.36 gmyth_file_get_filesize( file));
9.37
9.38 - init_failed: if ( livetv != NULL)
9.39 - g_object_unref(livetv);
9.40 + init_failed:
9.41
9.42 if ( file != NULL)
9.43 g_object_unref(file);
10.1 --- a/gmyth/tests/gmyth_test_http.c Tue May 01 23:02:19 2007 +0100
10.2 +++ b/gmyth/tests/gmyth_test_http.c Wed May 02 16:11:14 2007 +0100
10.3 @@ -1,5 +1,5 @@
10.4 #include <glib-object.h>
10.5 -#include "gmyth.h"
10.6 +#include <gmyth/gmyth.h>
10.7 #include <glib.h>
10.8
10.9 #include "common.h"
11.1 --- a/gmyth/tests/gmyth_test_livetv.c Tue May 01 23:02:19 2007 +0100
11.2 +++ b/gmyth/tests/gmyth_test_livetv.c Wed May 02 16:11:14 2007 +0100
11.3 @@ -2,13 +2,13 @@
11.4
11.5 #include "common.h"
11.6
11.7 -#include "gmyth_uri.h"
11.8 -#include "gmyth_backendinfo.h"
11.9 -#include "gmyth_livetv.h"
11.10 -#include "gmyth_file.h"
11.11 -#include "gmyth_file_transfer.h"
11.12 -#include "gmyth_file_local.h"
11.13 -#include "gmyth_common.h"
11.14 +#include <gmyth/gmyth_uri.h>
11.15 +#include <gmyth/gmyth_backendinfo.h>
11.16 +#include <gmyth/gmyth_livetv.h>
11.17 +#include <gmyth/gmyth_file.h>
11.18 +#include <gmyth/gmyth_file_transfer.h>
11.19 +#include <gmyth/gmyth_file_local.h>
11.20 +#include <gmyth/gmyth_common.h>
11.21
11.22 #define URI_DEFAULT "myth://192.168.3.165:6543/livetv?channel=9"
11.23
12.1 --- a/gmyth/tests/gmyth_test_recorder.c Tue May 01 23:02:19 2007 +0100
12.2 +++ b/gmyth/tests/gmyth_test_recorder.c Wed May 02 16:11:14 2007 +0100
12.3 @@ -1,10 +1,10 @@
12.4 #include <glib-object.h>
12.5
12.6 -#include "gmyth_backendinfo.h"
12.7 -#include "gmyth_remote_util.h"
12.8 -#include "gmyth_query.h"
12.9 -#include "gmyth_epg.h"
12.10 -#include "gmyth_common.h"
12.11 +#include <gmyth/gmyth_backendinfo.h>
12.12 +#include <gmyth/gmyth_remote_util.h>
12.13 +#include <gmyth/gmyth_query.h>
12.14 +#include <gmyth/gmyth_epg.h>
12.15 +#include <gmyth/gmyth_common.h>
12.16
12.17 #include "common.h"
12.18
13.1 --- a/gmyth/tests/gmyth_test_recordings.c Tue May 01 23:02:19 2007 +0100
13.2 +++ b/gmyth/tests/gmyth_test_recordings.c Wed May 02 16:11:14 2007 +0100
13.3 @@ -1,10 +1,10 @@
13.4 #include <glib-object.h>
13.5
13.6 -#include "gmyth_uri.h"
13.7 -#include "gmyth_backendinfo.h"
13.8 -#include "gmyth_scheduler.h"
13.9 -#include "gmyth_epg.h"
13.10 -#include "gmyth_common.h"
13.11 +#include <gmyth/gmyth_uri.h>
13.12 +#include <gmyth/gmyth_backendinfo.h>
13.13 +#include <gmyth/gmyth_scheduler.h>
13.14 +#include <gmyth/gmyth_epg.h>
13.15 +#include <gmyth/gmyth_common.h>
13.16
13.17 #include "common.h"
13.18
14.1 --- a/gmyth/tests/gmyth_test_vlc.c Tue May 01 23:02:19 2007 +0100
14.2 +++ b/gmyth/tests/gmyth_test_vlc.c Wed May 02 16:11:14 2007 +0100
14.3 @@ -1,5 +1,5 @@
14.4 #include <glib-object.h>
14.5 -#include "gmyth.h"
14.6 +#include <gmyth/gmyth.h>
14.7 #include <glib.h>
14.8
14.9 #include "common.h"
15.1 --- a/gmyth/tests/main.c Tue May 01 23:02:19 2007 +0100
15.2 +++ b/gmyth/tests/main.c Wed May 02 16:11:14 2007 +0100
15.3 @@ -2,16 +2,22 @@
15.4 #include <glib.h>
15.5 #include <gmyth/gmyth.h>
15.6
15.7 +#include "common.h"
15.8 +
15.9 int
15.10 main (int args, const char **argv)
15.11 {
15.12 const char *uri = argv[1];
15.13 GMythURI *gmyth_uri = NULL;
15.14 gboolean res;
15.15 - GMythBackendInfo *backend_info;
15.16 + GMythBackendInfo *backend_info = NULL;
15.17 g_type_init ();
15.18 g_thread_init (NULL);
15.19
15.20 + fprintf(stdout, SYNC_STRING);
15.21 + fflush(NULL);
15.22 + getchar();
15.23 +
15.24 backend_info = gmyth_backend_info_new ();
15.25 gmyth_uri = gmyth_uri_new_with_value (uri);
15.26
15.27 @@ -31,7 +37,7 @@
15.28 return -1;
15.29 }
15.30
15.31 - guint64 filesize = gmyth_file_transfer_get_filesize (file_transfer);
15.32 + gint64 filesize = gmyth_file_transfer_get_filesize (file_transfer);
15.33 if (filesize <= 0) {
15.34 g_debug ("filesize is 0");
15.35 return -1;
15.36 @@ -41,10 +47,15 @@
15.37 guint num = gmyth_file_transfer_read (file_transfer, data, filesize, FALSE);
15.38 g_debug ("read %d bytes", num);
15.39
15.40 - g_byte_array_free (data, TRUE);
15.41 - g_object_unref (file_transfer);
15.42 - g_object_unref (gmyth_uri);
15.43 - g_string_free (hostname, TRUE);
15.44 + if ( data != NULL )
15.45 + g_byte_array_free (data, TRUE);
15.46 + if ( file_transfer != NULL )
15.47 + g_object_unref (file_transfer);
15.48 + if ( gmyth_uri != NULL )
15.49 + g_object_unref (gmyth_uri);
15.50 + if ( hostname != NULL )
15.51 + g_string_free (hostname, TRUE);
15.52
15.53 - return 0;
15.54 + return (0);
15.55 }
15.56 +
16.1 --- a/gmyth/tests/testing_tools.py Tue May 01 23:02:19 2007 +0100
16.2 +++ b/gmyth/tests/testing_tools.py Wed May 02 16:11:14 2007 +0100
16.3 @@ -88,6 +88,7 @@
16.4
16.5 def get_gcda(exe):
16.6 #exe_args = exe.split(' ')
16.7 + print "Get GCDA - %s" % exe
16.8 f = open(exe[0])
16.9 data = f.read()
16.10 f.close()