Merge branch 'master' of gitea.larke.org:kevin/cwtest

# Conflicts:
#	src/cwtest/cfg/main.cfg
This commit is contained in:
kevin 2020-11-10 17:22:59 -05:00
commit a7c4ae5349
5 changed files with 56 additions and 21 deletions

View File

@ -17,15 +17,15 @@ include_HEADERS =
WS_DIR = $(HOME)/sdk/libwebsockets/build/out WS_DIR = $(HOME)/sdk/libwebsockets/build/out
AM_CPPFLAGS = -D _GNU_SOURCE -I.. -I$(srcdir)/src/libcw AM_CPPFLAGS = -I.. -I$(srcdir)/src/libcw
AM_CFLAGS = -Wno-multichar AM_CFLAGS = -Wno-multichar
AM_CXXFLAGS = -Wno-multichar AM_CXXFLAGS = -Wno-multichar
AM_LDFLAGS = AM_LDFLAGS =
# debug/release switches # debug/release switches
if DEBUG if DEBUG
AM_CFLAGS += -g AM_CFLAGS += -g
AM_CXXFLAGS += -g -Wall AM_CXXFLAGS += -g -Wall -fsanitize=undefined
else else
AM_CFLAGS += -O3 AM_CFLAGS += -O3
AM_CXXFLAGS += -O3 AM_CXXFLAGS += -O3
@ -62,16 +62,18 @@ endif
include src/libcw/Makefile.am include src/libcw/Makefile.am
libcw_la_SOURCES = $(libcwSRC) $(libcwHDR) #libcw_la_SOURCES = $(libcwSRC) $(libcwHDR)
lib_LTLIBRARIES += libcw.la #lib_LTLIBRARIES += libcw.la
include_HEADERS += $(libcwHDR) #include_HEADERS += $(libcwHDR)
src_cwtest_cwtest_SOURCES = src/cwtest/main.cpp src_cwtest_cwtest_SOURCES = $(libcwHDR) $(libcwSRC) src/cwtest/main.cpp
# 1) autoconfig manual recommends setting direct referenes to non-3rd party libraries rather than using -L and -l # 1) autoconfig manual recommends setting direct referenes to non-3rd party libraries rather than using -L and -l
# 2) -ldl is required for dlopen(),dlclose() ... # 2) -ldl is required for dlopen(),dlclose() ...
src_cwtest_cwtest_LDADD = libcw.la -lpthread -ldl # src_cwtest_cwtest_LDADD = libcw.la -lpthread -ldl
src_cwtest_cwtest_LDADD = -lpthread -ldl
if cwFFTW if cwFFTW
src_cwtest_cwtest_LDADD += -lfftw3 -lfftw3f src_cwtest_cwtest_LDADD += -lfftw3 -lfftw3f

View File

@ -15,7 +15,7 @@ cd ${curdir}
# To enable websock: --enable-websock \ # To enable websock: --enable-websock \
# To enable alsa: --enable-alsa \ # To enable alsa: --enable-alsa \
../../../configure --prefix=${curdir} --enable-debug --enable-alsa \ ../../../configure --prefix=${curdir} --enable-debug --enable-websock --enable-alsa \
CFLAGS="-g -Wall" \ CFLAGS="-g -Wall" \
CXXFLAGS="-g -Wall" \ CXXFLAGS="-g -Wall" \
CPPFLAGS="-I${HOME}/sdk/libwebsockets/build/out/include" \ CPPFLAGS="-I${HOME}/sdk/libwebsockets/build/out/include" \

View File

@ -5,9 +5,9 @@
AC_COPYRIGHT([Copyright (C) 2019-2020 Kevin Larke]) AC_COPYRIGHT([Copyright (C) 2019-2020 Kevin Larke])
AC_INIT([cwtest],[1.0],[cwtest@larke.org]) AC_INIT([cwtest],[1.0],[cwtest@larke.org])
AC_CONFIG_SRCDIR([src/cwtest/main.cpp])
AC_CONFIG_AUX_DIR([build-aux]) # put aux files in build-aux AC_CONFIG_AUX_DIR([build-aux]) # put aux files in build-aux
AM_INIT_AUTOMAKE([1.9 -Wall foreign subdir-objects]) # subdir-objects needed for non-recursive make AM_INIT_AUTOMAKE([1.9 -Wall foreign subdir-objects]) # subdir-objects needed for non-recursive make
AC_CONFIG_SRCDIR([src/cwtest/main.cpp])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIRS([m4]) AC_CONFIG_MACRO_DIRS([m4])
@ -61,8 +61,8 @@ AX_FUNC_OS_TYPE
AX_FUNC_OS_64 AX_FUNC_OS_64
# ac_cv_os_type is set by AX_FUNC_OS_TYPE # ac_cv_os_type is set by AX_FUNC_OS_TYPE
AM_CONDITIONAL([OS_LINUX],[test x"${ax_cv_os_type}" = xLinux]) AM_CONDITIONAL([OS_LINUX],[test x"${ax_cv_os_type}" == xLinux])
AM_CONDITIONAL([OS_OSX],[test x"${ax_cv_os_type}" = xDarwin]) AM_CONDITIONAL([OS_OSX],[test x"${ax_cv_os_type}" == xDarwin])
echo "OS='${ax_cv_os_type}'" echo "OS='${ax_cv_os_type}'"
AM_CONDITIONAL([OS_64],[test x"${ax_cv_os_64}" == xx86_64]) AM_CONDITIONAL([OS_64],[test x"${ax_cv_os_64}" == xx86_64])
@ -82,7 +82,7 @@ AC_ARG_ENABLE([debug],
echo "debug=${debug}" echo "debug=${debug}"
AM_CONDITIONAL([DEBUG], [test x$debug = xtrue]) AM_CONDITIONAL([DEBUG], [test x$debug == xtrue])
if test x$debug = xfalse; then if test x$debug = xfalse; then
AC_DEFINE([NDEBUG], 1,[Debugging off.]) AC_DEFINE([NDEBUG], 1,[Debugging off.])
@ -103,7 +103,7 @@ if test x"$websock" = xtrue; then
AC_CHECK_LIB([websockets],[lws_get_library_version],[AC_MSG_RESULT([The 'websockets' library was found.])],[AC_MSG_ERROR([The 'websockets' library was not found.])]) AC_CHECK_LIB([websockets],[lws_get_library_version],[AC_MSG_RESULT([The 'websockets' library was found.])],[AC_MSG_ERROR([The 'websockets' library was not found.])])
AC_DEFINE([cwWEBSOCK], 1,[Use libwebsock.]) AC_DEFINE([cwWEBSOCK], 1,[Use libwebsock.])
fi fi
AM_CONDITIONAL([cwWEBSOCK], [test x$websock = xtrue]) AM_CONDITIONAL([cwWEBSOCK], [test x$websock == xtrue])
echo "websock=${websock}" echo "websock=${websock}"
@ -124,7 +124,7 @@ AC_CHECK_LIB([asound],[snd_asoundlib_version],[AC_MSG_RESULT([The 'ALSA' library
AC_DEFINE([cwALSA], 1,[Use libalsa.]) AC_DEFINE([cwALSA], 1,[Use libalsa.])
fi fi
AM_CONDITIONAL([cwALSA], [test x$alsa = xtrue]) AM_CONDITIONAL([cwALSA], [test x$alsa == xtrue])
echo "alsa=${alsa}" echo "alsa=${alsa}"
@ -165,7 +165,7 @@ if test x"$web" = xtrue; then
AC_DEFINE([cwWEB], 1,[Use libweb.]) AC_DEFINE([cwWEB], 1,[Use libweb.])
fi fi
AM_CONDITIONAL([cwWEB], [test x$web = xtrue]) AM_CONDITIONAL([cwWEB], [test x$web == xtrue])
echo "web=${web}" echo "web=${web}"

View File

@ -20,8 +20,35 @@
numbCvt: {}, numbCvt: {},
object: {}, object: {},
time:{}, time:{},
threadTest: {}, thread: {},
spscBuf: {}, spscBuf: {},
spscQueueTmpl: {},
websockSrv: {
physRootDir: "~/src/cwtest/src/libcw/html/websockSrvTest",
dfltHtmlPageFn: "test_websocket.html",
},
serialSrv: {},
midiDevice: {},
textBuf: {},
audioBuf: {},
audioDev: {},
audioDevAlsa: {},
audioDevRpt: {},
socket: {},
socketTcp: {},
socketSrvUdp: {},
socketSrvTcp: {},
sockMgrTest: {},
uiTest: {},
socketMdns: {},
dnssd: {},
eucon: {},
dirEntry: {},
io: {},
mtx: mtx:
{ {

View File

@ -358,14 +358,20 @@ cw::rc_t dnsSdTest( const cw::object_t* cfg, const cw::object_t* args
cw::rc_t euConTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::eucon::test(); } cw::rc_t euConTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::eucon::test(); }
#if defined(cwWEBSOCK) #if defined(cwWEBSOCK)
cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::websockSrvTest(); } cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::websockSrvTest(cfg); }
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::io::test(); }
cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::ui::test(); } cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::ui::test(); }
#if defined(cwALSA)
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return cw::io::test(); }
#else
cw::rc_t _no_alsa_websock() { return cwLogError(cw::kResourceNotAvailableRC,"Websock or ALSA functionality not included in this build."); }
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_alsa_websock(); }
#endif
#else #else
cw::rc_t _no_websock() { return cwLogError(cw::kResourceNotAvailableRC,"Websocket functionality not included in this build."); } cw::rc_t _no_websock() { return cwLogError(cw::kResourceNotAvailableRC,"Websocket functionality not included in this build."); }
cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); } cw::rc_t websockSrvTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); } cw::rc_t uiTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
cw::rc_t ioTest( const cw::object_t* cfg, const cw::object_t* args, int argc, const char* argv[] ) { return _no_websock(); }
#endif #endif
@ -697,9 +703,9 @@ int main( int argc, const char* argv[] )
const char* cfgFn = argc > 1 ? argv[1] : nullptr; const char* cfgFn = argc > 1 ? argv[1] : nullptr;
const char* mode = argc > 2 ? argv[2] : nullptr; const char* mode = argc > 2 ? argv[2] : nullptr;
cw::log::createGlobal(); cw::log::createGlobal();
// if valid command line args were given and the cfg file was successfully read // if valid command line args were given and the cfg file was successfully read
if( cfgFn != nullptr && mode != nullptr && objectFromFile( cfgFn, cfg ) == cw::kOkRC ) if( cfgFn != nullptr && mode != nullptr && objectFromFile( cfgFn, cfg ) == cw::kOkRC )
{ {