Browse Source

Build a test version of libespeak-ng that exposes the internal APIs.

master
Reece H. Dunn 8 years ago
parent
commit
efd1df3206
4 changed files with 32 additions and 13 deletions
  1. 4
    0
      .gitignore
  2. 20
    13
      Makefile.am
  3. 4
    0
      src/libespeak-ng/espeak_command.c
  4. 4
    0
      src/libespeak-ng/fifo.c

+ 4
- 0
.gitignore View File

libespeak-ng.la libespeak-ng.la
libespeak-ng.so* libespeak-ng.so*


libespeak-ng-test.a
libespeak-ng-test.la
libespeak-ng-test.so*

# build output # build output


*.html *.html

+ 20
- 13
Makefile.am View File

noinst_bin_PROGRAMS = noinst_bin_PROGRAMS =
noinst_bindir = noinst_bindir =


noinst_lib_LTLIBRARIES =
noinst_libdir =

##### ChangeLog: ##### ChangeLog:


ChangeLog: ChangeLog:
-pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -DLIBESPEAK_NG_EXPORT \ -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -DLIBESPEAK_NG_EXPORT \
${PCAUDIOLIB_CFLAGS} ${AM_CFLAGS} ${PCAUDIOLIB_CFLAGS} ${AM_CFLAGS}


UCD_TOOLS_SOURCES = \
src_libespeak_ng_la_SOURCES = \
src/ucd-tools/src/case.c \ src/ucd-tools/src/case.c \
src/ucd-tools/src/categories.c \ src/ucd-tools/src/categories.c \
src/ucd-tools/src/ctype.c \ src/ucd-tools/src/ctype.c \
src/ucd-tools/src/proplist.c \ src/ucd-tools/src/proplist.c \
src/ucd-tools/src/scripts.c \ src/ucd-tools/src/scripts.c \
src/ucd-tools/src/tostring.c

src_libespeak_ng_la_SOURCES = \
$(UCD_TOOLS_SOURCES) \
src/ucd-tools/src/tostring.c \
src/libespeak-ng/compiledata.c \ src/libespeak-ng/compiledata.c \
src/libespeak-ng/compiledict.c \ src/libespeak-ng/compiledict.c \
src/libespeak-ng/compilembrola.c \ src/libespeak-ng/compilembrola.c \


##### tests: ##### tests:


# Test version of libespeak-ng.so with access to the internal APIs, so they can
# be accessed in the test code. This version should not be installed, as the
# internal APIs are not guaranteed to be stable between releases.
lib_LTLIBRARIES += src/libespeak-ng-test.la

src_libespeak_ng_test_la_LDFLAGS = $(src_libespeak_ng_la_LDFLAGS)
src_libespeak_ng_test_la_CFLAGS = \
-fPIC -pedantic -fno-exceptions -D PATH_ESPEAK_DATA=\"$(DATADIR)\" -DLIBESPEAK_NG_EXPORT \
${PCAUDIOLIB_CFLAGS} ${AM_CFLAGS}
src_libespeak_ng_test_la_SOURCES = $(src_libespeak_ng_la_SOURCES)

noinst_bin_PROGRAMS += tests/encoding.test noinst_bin_PROGRAMS += tests/encoding.test


tests_encoding_test_LDADD = src/libespeak-ng.la tests_encoding_test_LDADD = src/libespeak-ng.la


noinst_bin_PROGRAMS += tests/tokenizer.test noinst_bin_PROGRAMS += tests/tokenizer.test


tests_tokenizer_test_CFLAGS = -Isrc/libespeak-ng ${AM_CFLAGS}
tests_tokenizer_test_SOURCES = \
$(UCD_TOOLS_SOURCES) \
src/libespeak-ng/encoding.c \
src/libespeak-ng/mnemonics.c \
src/libespeak-ng/tokenizer.c \
tests/tokenizer.c
tests_tokenizer_test_CFLAGS = -Isrc/libespeak-ng ${AM_CFLAGS}
tests_tokenizer_test_LDADD = src/libespeak-ng-test.la
tests_tokenizer_test_SOURCES = tests/tokenizer.c


noinst_bin_PROGRAMS += tests/voices.test noinst_bin_PROGRAMS += tests/voices.test


tests_voices_test_LDADD = src/libespeak-ng.la
tests_voices_test_LDADD = src/libespeak-ng-test.la
tests_voices_test_CFLAGS = -Isrc/libespeak-ng ${AM_CFLAGS} tests_voices_test_CFLAGS = -Isrc/libespeak-ng ${AM_CFLAGS}
tests_voices_test_SOURCES = tests/voices.c tests_voices_test_SOURCES = tests/voices.c



+ 4
- 0
src/libespeak-ng/espeak_command.c View File

#include "speech.h" #include "speech.h"
#include "espeak_command.h" #include "espeak_command.h"


#ifdef USE_ASYNC

static unsigned int my_current_text_id = 0; static unsigned int my_current_text_id = 0;


t_espeak_command *create_espeak_text(const void *text, size_t size, unsigned int position, espeak_POSITION_TYPE position_type, unsigned int end_position, unsigned int flags, void *user_data) t_espeak_command *create_espeak_text(const void *text, size_t size, unsigned int position, espeak_POSITION_TYPE position_type, unsigned int end_position, unsigned int flags, void *user_data)
break; break;
} }
} }

#endif

+ 4
- 0
src/libespeak-ng/fifo.c View File

#include "fifo.h" #include "fifo.h"
#include "event.h" #include "event.h"


#ifdef USE_ASYNC

// my_mutex: protects my_thread_is_talking, // my_mutex: protects my_thread_is_talking,
// my_stop_is_required, and the command fifo // my_stop_is_required, and the command fifo
static pthread_mutex_t my_mutex; static pthread_mutex_t my_mutex;


init(0); // purge fifo init(0); // purge fifo
} }

#endif

Loading…
Cancel
Save