1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

Moved tests -> unittests

This commit is contained in:
James Booth 2015-05-28 18:50:55 +01:00
parent 0c99dc7ad6
commit 6d6bb64588
58 changed files with 52 additions and 50 deletions

2
.gitignore vendored
View File

@ -71,3 +71,5 @@ main_fragment.html
toc_fragment.html
stabbertests/stabbertestsuite
stabbertests/stabbertestsuite.trs
unittests/unittests
unittests/unittests.trs

View File

@ -35,7 +35,7 @@ core_sources = \
src/config/preferences.c src/config/preferences.h \
src/config/theme.c src/config/theme.h
test_sources = \
unittest_sources = \
src/contact.c src/contact.h src/common.c \
src/log.h src/profanity.c src/common.h \
src/profanity.h src/chat_session.c \
@ -65,34 +65,34 @@ test_sources = \
src/event/server_events.c src/event/server_events.h \
src/event/client_events.c src/event/client_events.h \
src/event/ui_events.c src/event/ui_events.h \
tests/xmpp/stub_xmpp.c \
tests/ui/stub_ui.c \
tests/log/stub_log.c \
tests/config/stub_accounts.c \
tests/helpers.c tests/helpers.h \
tests/test_cmd_account.c tests/test_cmd_account.h \
tests/test_cmd_alias.c tests/test_cmd_alias.h \
tests/test_cmd_bookmark.c tests/test_cmd_bookmark.h \
tests/test_cmd_connect.c tests/test_cmd_connect.h \
tests/test_cmd_join.c tests/test_cmd_join.h \
tests/test_cmd_otr.c tests/test_cmd_otr.h \
tests/test_cmd_rooms.c tests/test_cmd_rooms.h \
tests/test_cmd_roster.c tests/test_cmd_roster.h \
tests/test_cmd_statuses.c tests/test_cmd_statuses.h \
tests/test_cmd_sub.c tests/test_cmd_sub.h \
tests/test_cmd_disconnect.c tests/test_cmd_disconnect.h \
tests/test_common.c tests/test_common.h \
tests/test_contact.c tests/test_contact.h \
tests/test_form.c tests/test_form.h \
tests/test_jid.c tests/test_jid.h \
tests/test_muc.c tests/test_muc.h \
tests/test_parser.c tests/test_parser.h \
tests/test_preferences.c tests/test_preferences.h \
tests/test_roster_list.c tests/test_roster_list.h \
tests/test_server_events.c tests/test_server_events.h \
tests/test_autocomplete.c tests/test_autocomplete.h \
tests/test_chat_session.c tests/test_chat_session.h \
tests/testsuite.c
unittests/xmpp/stub_xmpp.c \
unittests/ui/stub_ui.c \
unittests/log/stub_log.c \
unittests/config/stub_accounts.c \
unittests/helpers.c unittests/helpers.h \
unittests/test_cmd_account.c unittests/test_cmd_account.h \
unittests/test_cmd_alias.c unittests/test_cmd_alias.h \
unittests/test_cmd_bookmark.c unittests/test_cmd_bookmark.h \
unittests/test_cmd_connect.c unittests/test_cmd_connect.h \
unittests/test_cmd_join.c unittests/test_cmd_join.h \
unittests/test_cmd_otr.c unittests/test_cmd_otr.h \
unittests/test_cmd_rooms.c unittests/test_cmd_rooms.h \
unittests/test_cmd_roster.c unittests/test_cmd_roster.h \
unittests/test_cmd_statuses.c unittests/test_cmd_statuses.h \
unittests/test_cmd_sub.c unittests/test_cmd_sub.h \
unittests/test_cmd_disconnect.c unittests/test_cmd_disconnect.h \
unittests/test_common.c unittests/test_common.h \
unittests/test_contact.c unittests/test_contact.h \
unittests/test_form.c unittests/test_form.h \
unittests/test_jid.c unittests/test_jid.h \
unittests/test_muc.c unittests/test_muc.h \
unittests/test_parser.c unittests/test_parser.h \
unittests/test_preferences.c unittests/test_preferences.h \
unittests/test_roster_list.c unittests/test_roster_list.h \
unittests/test_server_events.c unittests/test_server_events.h \
unittests/test_autocomplete.c unittests/test_autocomplete.h \
unittests/test_chat_session.c unittests/test_chat_session.h \
unittests/unittests.c
stabbertest_sources = \
stabbertests/proftest.c stabbertests/proftest.h \
@ -109,8 +109,8 @@ otr3_sources = \
otr4_sources = \
src/otr/otrlib.h src/otr/otrlibv4.c src/otr/otr.h src/otr/otr.c
otr_test_sources = \
tests/otr/stub_otr.c
otr_unittest_sources = \
unittests/otr/stub_otr.c
themes_sources = themes/*
@ -119,7 +119,7 @@ script_sources = bootstrap.sh configure-debug install-all.sh
man_sources = docs/profanity.1
if BUILD_OTR
test_sources += $(otr_test_sources)
unittest_sources += $(otr_unittest_sources)
if BUILD_OTR3
core_sources += $(otr3_sources)
endif
@ -138,10 +138,10 @@ if INCLUDE_GIT_VERSION
BUILT_SOURCES = $(git_include)
endif
TESTS = tests/testsuite stabbertests/stabbertestsuite
check_PROGRAMS = tests/testsuite stabbertests/stabbertestsuite
tests_testsuite_SOURCES = $(test_sources)
tests_testsuite_LDADD = -lcmocka
TESTS = unittests/unittests stabbertests/stabbertestsuite
check_PROGRAMS = unittests/unittests stabbertests/stabbertestsuite
unittests_unittests_SOURCES = $(unittest_sources)
unittests_unittests_LDADD = -lcmocka
stabbertests_stabbertestsuite_SOURCES = $(stabbertest_sources)
stabbertests_stabbertestsuite_CFLAGS = -I/usr/include/tcl8.6 -I/usr/include/tcl8.5
stabbertests_stabbertestsuite_LDADD = -lcmocka -lstabber -lexpect -ltcl

View File

@ -121,6 +121,19 @@ _cleanup_dirs(void)
}
}
void
prof_start(void)
{
fd = exp_spawnl("./profanity", NULL);
FILE *fp = fdopen(fd, "r+");
if (fp == NULL) {
assert_true(FALSE);
}
setbuf(fp, (char *)0);
}
void
init_prof_test(void **state)
{
@ -156,19 +169,6 @@ close_prof_test(void **state)
stbbr_stop();
}
void
prof_start(void)
{
fd = exp_spawnl("./profanity", NULL);
FILE *fp = fdopen(fd, "r+");
if (fp == NULL) {
assert_true(FALSE);
}
setbuf(fp, (char *)0);
}
void
prof_input(char *input)
{

View File

@ -7,7 +7,7 @@
#include "ui/window.h"
#include "ui/ui.h"
#include "tests/ui/stub_ui.h"
#include "unittests/ui/stub_ui.h"
// mock state