Reduce duplicate data. Add a mostly empty skeleton test.

This commit is contained in:
Coren[m] 2013-11-06 20:32:02 +01:00
parent 71f7a49402
commit fdefb18fc1
No known key found for this signature in database
GPG Key ID: AFA6943800F5DC6D
2 changed files with 72 additions and 31 deletions

View File

@ -4,15 +4,12 @@ TESTS = messenger_autotest crypto_test network_test
check_PROGRAMS = messenger_autotest crypto_test network_test
messenger_autotest_SOURCES = \
../auto_tests/messenger_test.c
messenger_autotest_CFLAGS = \
AUTOTEST_CFLAGS = \
$(LIBSODIUM_CFLAGS) \
$(NACL_CFLAGS) \
$(CHECK_CFLAGS)
messenger_autotest_LDADD = \
AUTOTEST_LDADD = \
$(LIBSODIUM_LDFLAGS) \
$(NACL_LDFLAGS) \
libtoxcore.la \
@ -20,35 +17,26 @@ messenger_autotest_LDADD = \
$(NACL_LIBS) \
$(CHECK_LIBS)
messenger_autotest_SOURCES = ../auto_tests/messenger_test.c
messenger_autotest_CFLAGS = $(AUTOTEST_CFLAGS)
messenger_autotest_LDADD = $(AUTOTEST_LDADD)
crypto_test_SOURCES = ../auto_tests/crypto_test.c
crypto_test_CFLAGS = $(LIBSODIUM_CFLAGS) \
$(NACL_CFLAGS) \
$(CHECK_CFLAGS)
crypto_test_CFLAGS = $(AUTOTEST_CFLAGS)
crypto_test_LDADD = $(LIBSODIUM_LDFLAGS) \
$(NACL_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(NACL_LIBS) \
$(CHECK_LIBS)
crypto_test_LDADD = $(AUTOTEST_LDADD)
network_test_SOURCES = \
../auto_tests/network_test.c
network_test_CFLAGS = \
$(LIBSODIUM_CFLAGS) \
$(NACL_CFLAGS) \
$(CHECK_CFLAGS)
network_test_SOURCES = ../auto_tests/network_test.c
network_test_CFLAGS = $(AUTOTEST_CFLAGS)
network_test_LDADD = $(AUTOTEST_LDADD)
network_test_LDADD = \
$(LIBSODIUM_LDFLAGS) \
$(NACL_LDFLAGS) \
libtoxcore.la \
$(LIBSODIUM_LIBS) \
$(NACL_LIBS) \
$(CHECK_LIBS)
endif

View File

@ -0,0 +1,53 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#include <sys/types.h>
#include <stdint.h>
#include <string.h>
#include <check.h>
#include <stdlib.h>
#include <time.h>
/*
#include "../<stuff to test>"
*/
START_TEST(test_creativetestnamegoeshere)
{
uint8_t test = 0;
ck_assert_msg(test == 0, "test: expected result 0, got %u.", test);
}
END_TEST
#define DEFTESTCASE(NAME) \
TCase *tc_##NAME = tcase_create(#NAME); \
tcase_add_test(tc_##NAME, test_##NAME); \
suite_add_tcase(s, tc_##NAME);
Suite *creativesuitenamegoeshere_suite(void)
{
Suite *s = suite_create("creativesuitedescritptiongoeshere");
DEFTESTCASE(/* remove test_ from test function names */ creativetestnamegoeshere);
return s;
}
int main(int argc, char *argv[])
{
srand((unsigned int) time(NULL));
Suite *creativesuitenamegoeshere = creativesuitenamegoeshere_suite();
SRunner *test_runner = srunner_create(creativesuitenamegoeshere);
int number_failed = 0;
srunner_run_all(test_runner, CK_NORMAL);
number_failed = srunner_ntests_failed(test_runner);
srunner_free(test_runner);
return number_failed;
}