Add spectest to the cmake test suite.

This allows for easier development. It is not used on travis (yet).
This commit is contained in:
iphydf 2016-11-08 21:56:54 +00:00
parent dd5e69b3bf
commit 42dfdf73c1
No known key found for this signature in database
GPG Key ID: 3855DBA2D74403C9
6 changed files with 34 additions and 6 deletions

View File

@ -163,6 +163,9 @@ pkg_use_module(LIBCONFIG libconfig )
# For auto tests.
pkg_use_module(CHECK check )
# For tox-spectest.
pkg_use_module(MSGPACK msgpack )
# For av_test.
pkg_use_module(OPENCV opencv )
pkg_use_module(PORTAUDIO portaudio-2.0 )
@ -337,6 +340,31 @@ add_module(toxencryptsave
toxencryptsave/toxencryptsave.c)
target_link_modules(toxencryptsave toxcore)
################################################################################
#
# :: Tox specification tests
#
################################################################################
find_program(SPECTEST NAMES
tox-spectest
${CMAKE_SOURCE_DIR}/../.cabal-sandbox/bin/tox-spectest)
if(SPECTEST AND MSGPACK_FOUND)
add_c_executable(toxcore-sut
testing/hstox/binary_decode.c
testing/hstox/binary_encode.c
testing/hstox/driver.c
testing/hstox/methods.c
testing/hstox/packet_kinds.c
testing/hstox/test_main.c
testing/hstox/util.c)
target_link_modules(toxcore-sut
toxcore
${MSGPACK_LIBRARIES})
add_test(NAME spectest COMMAND ${SPECTEST} $<TARGET_FILE:toxcore-sut>)
endif()
################################################################################
#
# :: Automated regression tests

View File

@ -3,7 +3,7 @@
#include "byteswap.h"
#include "packet_kinds.h"
#include <DHT.h>
#include "../../toxcore/DHT.h"
METHOD(bin, Binary_decode, CipherText)
{

View File

@ -3,7 +3,7 @@
#include "byteswap.h"
#include "packet_kinds.h"
#include <DHT.h>
#include "../../toxcore/DHT.h"
METHOD(bin, Binary_encode, CipherText)
{

View File

@ -17,7 +17,7 @@
#include <sodium.h>
static void handle_interrupt(int signum)
static void __attribute__((__noreturn__)) handle_interrupt(int signum)
{
printf("Caught signal %d; exiting cleanly.\n", signum);
exit(0);

View File

@ -2,8 +2,8 @@
#include "util.h"
#include <crypto_core.h>
#include <net_crypto.h>
#include "../../toxcore/crypto_core.h"
#include "../../toxcore/net_crypto.h"
char const *const failure = "Failure";
char const *const pending = "Pending";

View File

@ -1,6 +1,6 @@
#include "packet_kinds.h"
#include <network.h>
#include "../../toxcore/network.h"
uint8_t const packet_kinds[21] = {
// = PingRequest -- 0x00: Ping request