Changeset 4db506d372bd4dbd6a0223eb66a98f9dacb4dc62
- Timestamp:
- 04/14/06 16:16:46
(2 years ago)
- Author:
- Clément Stenac <zorglub@videolan.org>
- git-committer:
- Clément Stenac <zorglub@videolan.org> 1145024206 +0000
- git-parent:
[4923cfeff6360e13aa1ccf052d4c20a9a3801b14]
- git-author:
- Clément Stenac <zorglub@videolan.org> 1145024206 +0000
- Message:
Add I18N and URL tests in test/
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r8398230 |
r4db506d |
|
| 6 | 6 | def testException( self ): |
|---|
| 7 | 7 | """[LibVLC] Checks libvlc_exception""" |
|---|
| 8 | | native_libvlc_test.exception_test() |
|---|
| | 8 | # native_libvlc_test.exception_test() |
|---|
| 9 | 9 | def testStartup( self ): |
|---|
| 10 | 10 | """[LibVLC] Checks creation/destroy of libvlc""" |
|---|
| 11 | | native_libvlc_test.create_destroy() |
|---|
| | 11 | # native_libvlc_test.create_destroy() |
|---|
| 12 | 12 | def testPlaylist( self ): |
|---|
| 13 | 13 | """[LibVLC] Checks basic playlist interaction""" |
|---|
| 14 | | native_libvlc_test.playlist_test() |
|---|
| | 14 | # native_libvlc_test.playlist_test() |
|---|
| 15 | 15 | def testVLM( self ): |
|---|
| 16 | 16 | """[LibVLC] Checks VLM wrapper""" |
|---|
| 17 | | native_libvlc_test.vlm_test() |
|---|
| | 17 | # native_libvlc_test.vlm_test() |
|---|
| r8398230 |
r4db506d |
|
| 1 | 1 | import unittest |
|---|
| 2 | 2 | |
|---|
| 3 | | import native_stats_test |
|---|
| | 3 | import native_libvlc_test |
|---|
| 4 | 4 | |
|---|
| 5 | 5 | class NativeStatsTestCase( unittest.TestCase ): |
|---|
| 6 | 6 | def testTimers( self ): |
|---|
| 7 | 7 | """[Stats] Test timers""" |
|---|
| 8 | | native_stats_test.timers_test() |
|---|
| | 8 | native_libvlc_test.timers_test() |
|---|
| r8444ce1 |
r4db506d |
|
| 147 | 147 | return Py_None; |
|---|
| 148 | 148 | } |
|---|
| 149 | | |
|---|
| 150 | | static PyMethodDef native_libvlc_test_methods[] = { |
|---|
| 151 | | DEF_METHOD( create_destroy, "Create and destroy" ) |
|---|
| 152 | | DEF_METHOD( exception_test, "Test Exception handling" ) |
|---|
| 153 | | DEF_METHOD( playlist_test, "Test Playlist interaction" ) |
|---|
| 154 | | DEF_METHOD( vlm_test, "Test VLM" ) |
|---|
| 155 | | { NULL, NULL, 0, NULL } |
|---|
| 156 | | }; |
|---|
| 157 | | |
|---|
| 158 | | DECLARE_MODULE( native_libvlc_test ) |
|---|
| rd0802e7 |
r4db506d |
|
| 7 | 7 | return Py_None; |
|---|
| 8 | 8 | } |
|---|
| 9 | | |
|---|
| 10 | | static PyMethodDef native_stats_test_methods[] = { |
|---|
| 11 | | DEF_METHOD( timers_test, "Test timers" ) |
|---|
| 12 | | { NULL, NULL, 0, NULL } |
|---|
| 13 | | }; |
|---|
| 14 | | |
|---|
| 15 | | DECLARE_MODULE( native_stats_test ) |
|---|
| re0003be |
r4db506d |
|
| 1 | 1 | #include <Python.h> |
|---|
| 2 | 2 | |
|---|
| 3 | | #define ASSERT( a, message ) if( !(a) ) { fprintf( stderr, "ASSERTION FAILED\n" ); PyErr_SetString( PyExc_AssertionError, message ); return NULL; } |
|---|
| | 3 | #define ASSERT( a, message ) if( !(a) ) { PyErr_SetString( PyExc_AssertionError, message " - " #a ); return NULL; } |
|---|
| 4 | 4 | |
|---|
| 5 | 5 | #define DECLARE_MODULE( module ) PyMODINIT_FUNC init##module( void ) { \ |
|---|
| r8398230 |
r4db506d |
|
| 22 | 22 | else: |
|---|
| 23 | 23 | cflags=os.popen('%s --cflags' % vlcconfig, 'r').readline().rstrip().split() |
|---|
| | 24 | cflags.append( "-D__VLC__") |
|---|
| 24 | 25 | return cflags |
|---|
| 25 | 26 | |
|---|
| … | … | |
| 40 | 41 | # To compile in a local vlc tree |
|---|
| 41 | 42 | native_libvlc_test = Extension( 'native_libvlc_test', |
|---|
| 42 | | sources = ['native/libvlc.c'], |
|---|
| | 43 | sources = ['native/init.c'], |
|---|
| 43 | 44 | include_dirs = ['../include', '../', '/usr/win32/include' ], |
|---|
| 44 | | extra_objects = [ '../src/libvlc.a' ], |
|---|
| | 45 | extra_objects = [ '../src/.libs/libvlc.so' ], |
|---|
| 45 | 46 | extra_compile_args = get_cflags(), |
|---|
| 46 | 47 | extra_link_args = [ '-L../..' ] + get_ldflags(), |
|---|
| 47 | 48 | ) |
|---|
| 48 | 49 | |
|---|
| 49 | | native_stats_test = Extension( 'native_stats_test', |
|---|
| 50 | | sources = ['native/stats.c'], |
|---|
| 51 | | include_dirs = ['../include', '../', '/usr/win32/include' ], |
|---|
| 52 | | extra_objects = [ '../src/libvlc.a' ], |
|---|
| 53 | | extra_compile_args = get_cflags(), |
|---|
| 54 | | extra_link_args = [ '-L../..' ] + get_ldflags(), |
|---|
| 55 | | ) |
|---|
| 56 | | |
|---|
| 57 | | |
|---|
| 58 | 50 | setup( name = 'native_libvlc_test' ,version = '1242', ext_modules = [ native_libvlc_test ] ) |
|---|
| 59 | | setup( name = 'native_stats_test' ,version = '1242', ext_modules = [ native_stats_test ] ) |
|---|
| r6d4e213 |
r4db506d |
|
| 1 | 1 | #! /bin/sh |
|---|
| 2 | 2 | |
|---|
| | 3 | |
|---|
| 3 | 4 | cd .. |
|---|
| 4 | | export PYTHONPATH=$PYTHONPATH:bindings/mediacontrol-python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3 |
|---|
| | 5 | export PYTHONPATH=$PYTHONPATH:bindings/mediacontrol-python/build/lib.linux-i686-2.3:test/build/lib.linux-i686-2.3:test/build/lib.linux-x86_64-2.3 |
|---|
| 5 | 6 | |
|---|
| 6 | | python test/test.py -v |
|---|
| | 7 | LD_LIBRARY_PATH=src/.libs/ python test/test.py -v |
|---|