mirror of
https://github.com/profanity-im/profanity.git
synced 2025-01-03 14:57:42 -05:00
Moved tests -> unittests
This commit is contained in:
parent
0c99dc7ad6
commit
6d6bb64588
2
.gitignore
vendored
2
.gitignore
vendored
@ -71,3 +71,5 @@ main_fragment.html
|
|||||||
toc_fragment.html
|
toc_fragment.html
|
||||||
stabbertests/stabbertestsuite
|
stabbertests/stabbertestsuite
|
||||||
stabbertests/stabbertestsuite.trs
|
stabbertests/stabbertestsuite.trs
|
||||||
|
unittests/unittests
|
||||||
|
unittests/unittests.trs
|
||||||
|
72
Makefile.am
72
Makefile.am
@ -35,7 +35,7 @@ core_sources = \
|
|||||||
src/config/preferences.c src/config/preferences.h \
|
src/config/preferences.c src/config/preferences.h \
|
||||||
src/config/theme.c src/config/theme.h
|
src/config/theme.c src/config/theme.h
|
||||||
|
|
||||||
test_sources = \
|
unittest_sources = \
|
||||||
src/contact.c src/contact.h src/common.c \
|
src/contact.c src/contact.h src/common.c \
|
||||||
src/log.h src/profanity.c src/common.h \
|
src/log.h src/profanity.c src/common.h \
|
||||||
src/profanity.h src/chat_session.c \
|
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/server_events.c src/event/server_events.h \
|
||||||
src/event/client_events.c src/event/client_events.h \
|
src/event/client_events.c src/event/client_events.h \
|
||||||
src/event/ui_events.c src/event/ui_events.h \
|
src/event/ui_events.c src/event/ui_events.h \
|
||||||
tests/xmpp/stub_xmpp.c \
|
unittests/xmpp/stub_xmpp.c \
|
||||||
tests/ui/stub_ui.c \
|
unittests/ui/stub_ui.c \
|
||||||
tests/log/stub_log.c \
|
unittests/log/stub_log.c \
|
||||||
tests/config/stub_accounts.c \
|
unittests/config/stub_accounts.c \
|
||||||
tests/helpers.c tests/helpers.h \
|
unittests/helpers.c unittests/helpers.h \
|
||||||
tests/test_cmd_account.c tests/test_cmd_account.h \
|
unittests/test_cmd_account.c unittests/test_cmd_account.h \
|
||||||
tests/test_cmd_alias.c tests/test_cmd_alias.h \
|
unittests/test_cmd_alias.c unittests/test_cmd_alias.h \
|
||||||
tests/test_cmd_bookmark.c tests/test_cmd_bookmark.h \
|
unittests/test_cmd_bookmark.c unittests/test_cmd_bookmark.h \
|
||||||
tests/test_cmd_connect.c tests/test_cmd_connect.h \
|
unittests/test_cmd_connect.c unittests/test_cmd_connect.h \
|
||||||
tests/test_cmd_join.c tests/test_cmd_join.h \
|
unittests/test_cmd_join.c unittests/test_cmd_join.h \
|
||||||
tests/test_cmd_otr.c tests/test_cmd_otr.h \
|
unittests/test_cmd_otr.c unittests/test_cmd_otr.h \
|
||||||
tests/test_cmd_rooms.c tests/test_cmd_rooms.h \
|
unittests/test_cmd_rooms.c unittests/test_cmd_rooms.h \
|
||||||
tests/test_cmd_roster.c tests/test_cmd_roster.h \
|
unittests/test_cmd_roster.c unittests/test_cmd_roster.h \
|
||||||
tests/test_cmd_statuses.c tests/test_cmd_statuses.h \
|
unittests/test_cmd_statuses.c unittests/test_cmd_statuses.h \
|
||||||
tests/test_cmd_sub.c tests/test_cmd_sub.h \
|
unittests/test_cmd_sub.c unittests/test_cmd_sub.h \
|
||||||
tests/test_cmd_disconnect.c tests/test_cmd_disconnect.h \
|
unittests/test_cmd_disconnect.c unittests/test_cmd_disconnect.h \
|
||||||
tests/test_common.c tests/test_common.h \
|
unittests/test_common.c unittests/test_common.h \
|
||||||
tests/test_contact.c tests/test_contact.h \
|
unittests/test_contact.c unittests/test_contact.h \
|
||||||
tests/test_form.c tests/test_form.h \
|
unittests/test_form.c unittests/test_form.h \
|
||||||
tests/test_jid.c tests/test_jid.h \
|
unittests/test_jid.c unittests/test_jid.h \
|
||||||
tests/test_muc.c tests/test_muc.h \
|
unittests/test_muc.c unittests/test_muc.h \
|
||||||
tests/test_parser.c tests/test_parser.h \
|
unittests/test_parser.c unittests/test_parser.h \
|
||||||
tests/test_preferences.c tests/test_preferences.h \
|
unittests/test_preferences.c unittests/test_preferences.h \
|
||||||
tests/test_roster_list.c tests/test_roster_list.h \
|
unittests/test_roster_list.c unittests/test_roster_list.h \
|
||||||
tests/test_server_events.c tests/test_server_events.h \
|
unittests/test_server_events.c unittests/test_server_events.h \
|
||||||
tests/test_autocomplete.c tests/test_autocomplete.h \
|
unittests/test_autocomplete.c unittests/test_autocomplete.h \
|
||||||
tests/test_chat_session.c tests/test_chat_session.h \
|
unittests/test_chat_session.c unittests/test_chat_session.h \
|
||||||
tests/testsuite.c
|
unittests/unittests.c
|
||||||
|
|
||||||
stabbertest_sources = \
|
stabbertest_sources = \
|
||||||
stabbertests/proftest.c stabbertests/proftest.h \
|
stabbertests/proftest.c stabbertests/proftest.h \
|
||||||
@ -109,8 +109,8 @@ otr3_sources = \
|
|||||||
otr4_sources = \
|
otr4_sources = \
|
||||||
src/otr/otrlib.h src/otr/otrlibv4.c src/otr/otr.h src/otr/otr.c
|
src/otr/otrlib.h src/otr/otrlibv4.c src/otr/otr.h src/otr/otr.c
|
||||||
|
|
||||||
otr_test_sources = \
|
otr_unittest_sources = \
|
||||||
tests/otr/stub_otr.c
|
unittests/otr/stub_otr.c
|
||||||
|
|
||||||
themes_sources = themes/*
|
themes_sources = themes/*
|
||||||
|
|
||||||
@ -119,7 +119,7 @@ script_sources = bootstrap.sh configure-debug install-all.sh
|
|||||||
man_sources = docs/profanity.1
|
man_sources = docs/profanity.1
|
||||||
|
|
||||||
if BUILD_OTR
|
if BUILD_OTR
|
||||||
test_sources += $(otr_test_sources)
|
unittest_sources += $(otr_unittest_sources)
|
||||||
if BUILD_OTR3
|
if BUILD_OTR3
|
||||||
core_sources += $(otr3_sources)
|
core_sources += $(otr3_sources)
|
||||||
endif
|
endif
|
||||||
@ -138,10 +138,10 @@ if INCLUDE_GIT_VERSION
|
|||||||
BUILT_SOURCES = $(git_include)
|
BUILT_SOURCES = $(git_include)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
TESTS = tests/testsuite stabbertests/stabbertestsuite
|
TESTS = unittests/unittests stabbertests/stabbertestsuite
|
||||||
check_PROGRAMS = tests/testsuite stabbertests/stabbertestsuite
|
check_PROGRAMS = unittests/unittests stabbertests/stabbertestsuite
|
||||||
tests_testsuite_SOURCES = $(test_sources)
|
unittests_unittests_SOURCES = $(unittest_sources)
|
||||||
tests_testsuite_LDADD = -lcmocka
|
unittests_unittests_LDADD = -lcmocka
|
||||||
stabbertests_stabbertestsuite_SOURCES = $(stabbertest_sources)
|
stabbertests_stabbertestsuite_SOURCES = $(stabbertest_sources)
|
||||||
stabbertests_stabbertestsuite_CFLAGS = -I/usr/include/tcl8.6 -I/usr/include/tcl8.5
|
stabbertests_stabbertestsuite_CFLAGS = -I/usr/include/tcl8.6 -I/usr/include/tcl8.5
|
||||||
stabbertests_stabbertestsuite_LDADD = -lcmocka -lstabber -lexpect -ltcl
|
stabbertests_stabbertestsuite_LDADD = -lcmocka -lstabber -lexpect -ltcl
|
||||||
|
@ -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
|
void
|
||||||
init_prof_test(void **state)
|
init_prof_test(void **state)
|
||||||
{
|
{
|
||||||
@ -156,19 +169,6 @@ close_prof_test(void **state)
|
|||||||
stbbr_stop();
|
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
|
void
|
||||||
prof_input(char *input)
|
prof_input(char *input)
|
||||||
{
|
{
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
#include "ui/window.h"
|
#include "ui/window.h"
|
||||||
#include "ui/ui.h"
|
#include "ui/ui.h"
|
||||||
|
|
||||||
#include "tests/ui/stub_ui.h"
|
#include "unittests/ui/stub_ui.h"
|
||||||
|
|
||||||
// mock state
|
// mock state
|
||||||
|
|
Loading…
Reference in New Issue
Block a user