mirror of
https://github.com/irungentoo/toxcore.git
synced 2024-03-22 13:30:51 +08:00
Add spectest to the cmake test suite.
This allows for easier development. It is not used on travis (yet).
This commit is contained in:
parent
dd5e69b3bf
commit
42dfdf73c1
|
@ -163,6 +163,9 @@ pkg_use_module(LIBCONFIG libconfig )
|
||||||
# For auto tests.
|
# For auto tests.
|
||||||
pkg_use_module(CHECK check )
|
pkg_use_module(CHECK check )
|
||||||
|
|
||||||
|
# For tox-spectest.
|
||||||
|
pkg_use_module(MSGPACK msgpack )
|
||||||
|
|
||||||
# For av_test.
|
# For av_test.
|
||||||
pkg_use_module(OPENCV opencv )
|
pkg_use_module(OPENCV opencv )
|
||||||
pkg_use_module(PORTAUDIO portaudio-2.0 )
|
pkg_use_module(PORTAUDIO portaudio-2.0 )
|
||||||
|
@ -337,6 +340,31 @@ add_module(toxencryptsave
|
||||||
toxencryptsave/toxencryptsave.c)
|
toxencryptsave/toxencryptsave.c)
|
||||||
target_link_modules(toxencryptsave toxcore)
|
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
|
# :: Automated regression tests
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "byteswap.h"
|
#include "byteswap.h"
|
||||||
#include "packet_kinds.h"
|
#include "packet_kinds.h"
|
||||||
|
|
||||||
#include <DHT.h>
|
#include "../../toxcore/DHT.h"
|
||||||
|
|
||||||
METHOD(bin, Binary_decode, CipherText)
|
METHOD(bin, Binary_decode, CipherText)
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
#include "byteswap.h"
|
#include "byteswap.h"
|
||||||
#include "packet_kinds.h"
|
#include "packet_kinds.h"
|
||||||
|
|
||||||
#include <DHT.h>
|
#include "../../toxcore/DHT.h"
|
||||||
|
|
||||||
METHOD(bin, Binary_encode, CipherText)
|
METHOD(bin, Binary_encode, CipherText)
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
|
|
||||||
#include <sodium.h>
|
#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);
|
printf("Caught signal %d; exiting cleanly.\n", signum);
|
||||||
exit(0);
|
exit(0);
|
||||||
|
|
|
@ -2,8 +2,8 @@
|
||||||
|
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
|
||||||
#include <crypto_core.h>
|
#include "../../toxcore/crypto_core.h"
|
||||||
#include <net_crypto.h>
|
#include "../../toxcore/net_crypto.h"
|
||||||
|
|
||||||
char const *const failure = "Failure";
|
char const *const failure = "Failure";
|
||||||
char const *const pending = "Pending";
|
char const *const pending = "Pending";
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#include "packet_kinds.h"
|
#include "packet_kinds.h"
|
||||||
|
|
||||||
#include <network.h>
|
#include "../../toxcore/network.h"
|
||||||
|
|
||||||
uint8_t const packet_kinds[21] = {
|
uint8_t const packet_kinds[21] = {
|
||||||
// = PingRequest -- 0x00: Ping request
|
// = PingRequest -- 0x00: Ping request
|
||||||
|
|
Loading…
Reference in New Issue
Block a user