Skip to content
Snippets Groups Projects
Commit a835266f authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

unittest: add plugins

Create a minimal test for the plugins system.

GitLab: #745

Change-Id: I17d48860ce24cfdc5423d4dcc3cb44bb4d4531f6
parent 0b652eb7
Branches
No related tags found
No related merge requests found
...@@ -31,7 +31,9 @@ ...@@ -31,7 +31,9 @@
#include <mutex> #include <mutex>
#include <functional> #include <functional>
#include <ciso646> // fix windows compiler bug #include <ciso646> // fix windows compiler bug
#ifndef __DEBUG__ // this is only defined on plugins build for debugging
#include "logger.h" #include "logger.h"
#endif
namespace jami { namespace jami {
...@@ -127,7 +129,9 @@ protected: ...@@ -127,7 +129,9 @@ protected:
try { try {
so->update(this, data); so->update(this, data);
} catch (std::exception& e) { } catch (std::exception& e) {
#ifndef __DEBUG__
JAMI_ERR() << e.what(); JAMI_ERR() << e.what();
#endif
} }
} else { } else {
it = priority_observers_.erase(it); it = priority_observers_.erase(it);
......
...@@ -70,7 +70,7 @@ struct JamiMessage ...@@ -70,7 +70,7 @@ struct JamiMessage
/** /**
* @param accId AccountId * @param accId AccountId
* @param pId peerId * @param pId peerId
* @param isReceived False if local audio/video streams * @param isReceived True if received message, False if sent
* @param dataMap Message contents * @param dataMap Message contents
* @param pPlugin True if message is created/modified by plugin code * @param pPlugin True if message is created/modified by plugin code
*/ */
......
...@@ -452,4 +452,15 @@ if conf.get('ENABLE_VIDEO') ...@@ -452,4 +452,15 @@ if conf.get('ENABLE_VIDEO')
test('video_scaler', ut_video_scaler, test('video_scaler', ut_video_scaler,
workdir: ut_workdir, is_parallel: false, timeout: 1800 workdir: ut_workdir, is_parallel: false, timeout: 1800
) )
ut_plugins = executable('ut_plugins',
sources: files('unitTest/plugins/plugins.cpp'),
include_directories: ut_includedirs,
dependencies: ut_dependencies,
link_with: ut_library
)
test('plugins', ut_plugins,
workdir: ut_workdir, is_parallel: false, timeout: 1800
)
endif endif
...@@ -226,5 +226,10 @@ ut_sip_empty_offer_SOURCES = sip_account/sip_empty_offer.cpp ...@@ -226,5 +226,10 @@ ut_sip_empty_offer_SOURCES = sip_account/sip_empty_offer.cpp
check_PROGRAMS += ut_sip_srtp check_PROGRAMS += ut_sip_srtp
ut_sip_srtp_SOURCES = sip_account/sip_srtp.cpp ut_sip_srtp_SOURCES = sip_account/sip_srtp.cpp
#
# Plugins
#
check_PROGRAMS += ut_plugins
ut_plugins_SOURCES = plugins/plugins.cpp common.cpp
TESTS = $(check_PROGRAMS) TESTS = $(check_PROGRAMS)
COPYRIGHT NOTICE
Copyright (C) 2022 Savoir-faire Linux Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
plugin.yml
----------
The test configuration file can specify:
* jplDirectory - relative to the test executable or a full path;
* plugin - the plugin name;
* mediaHandlers - present media handlers names in the plugin;
* chatHandlers - present chat handlers names in the plugin;
The default test plugin is TestSuite.
Test plugin build
-----------------
For the CI tests, which uses a Ubuntu 20.04 docker, the test suite must be build with an appropriate glibc version, meaning a glib 3.31 or older.
Jami supports systems from Ubuntu 18.04, which uses glib 2.27.
If the plugin is build within a Ubuntu 18.04, it should work on all Jami supported platforms.
TO check your system glib version: `ldd --version`
File added
jplDirectory:
"plugins"
plugin:
"TestSuite"
mediaHandlers:
- "AudioHandlerTester"
- "VideoHandlerTester"
chatHandlers:
- "ChatHandlerTester"
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment