Skip to content

Commit

Permalink
Update: Separate integration and unit tests
Browse files Browse the repository at this point in the history
- Unit tests are now in `src/tests`
- Integration tests are in `tests`
  • Loading branch information
ePirat committed Aug 16, 2018
1 parent e35f9c9 commit d9793f4
Show file tree
Hide file tree
Showing 10 changed files with 61 additions and 34 deletions.
12 changes: 12 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,18 @@ config.h.in~
/tests/.libs/
/tests/ctest_*.test

# Ignore test output files
/src/ctest_*.log
/src/ctest_*.trs
/src/test-suite.log

# Ignore test build artifacts
/src/tests/*.lo
/src/libice_ctest.la
/src/ctest_*.test
/src/tests/.deps/
/src/tests/.dirstamp

# Ignore auxiliary files
/tap-driver.sh

Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ AS_CASE("${host_os}",
[SYS="${host_os}"]
)

AM_INIT_AUTOMAKE([tar-ustar foreign dist-zip])
AM_INIT_AUTOMAKE([tar-ustar foreign dist-zip subdir-objects])
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AM_MAINTAINER_MODE([enable])
Expand Down
2 changes: 2 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -140,3 +140,5 @@ icecast_DEPENDENCIES = \

icecast_LDADD = $(icecast_DEPENDENCIES)
icecast_CPPFLAGS = $(AM_CPPFLAGS) -I$(srcdir)/common

include $(srcdir)/tests/Makefile.am
40 changes: 40 additions & 0 deletions src/tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
## Process this file with automake to produce Makefile.in

######################
# Icecast unit tests #
######################

TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/tap-driver.sh

check_PROGRAMS =

#
# Helper library for TAP tests
#

libice_ctest_la_SOURCES = %reldir%/ctest_lib.c %reldir%/ctest_lib.h
noinst_LTLIBRARIES = libice_ctest.la

#
# Test programs
#

ctest_suite_test_SOURCES = %reldir%/ctest_suite.c
ctest_suite_test_LDADD = libice_ctest.la
check_PROGRAMS += ctest_suite.test

ctest_resourcematch_test_SOURCES = %reldir%/ctest_resourcematch.c
ctest_resourcematch_test_LDADD = libice_ctest.la icecast-resourcematch.o
check_PROGRAMS += ctest_resourcematch.test

ctest_refobject_test_SOURCES = %reldir%/ctest_refobject.c
ctest_refobject_test_LDADD = libice_ctest.la \
common/thread/libicethread.la \
common/avl/libiceavl.la \
icecast-refobject.o
check_PROGRAMS += ctest_refobject.test


# Add all programs to TESTS
TESTS = $(check_PROGRAMS)
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion tests/ctest_refobject.c → src/tests/ctest_refobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

#include "ctest_lib.h"

#include "../src/refobject.h"
#include "../refobject.h"

static void test_ptr(void)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

#include "ctest_lib.h"

#include "../src/resourcematch.h"
#include "../resourcematch.h"

struct test {
const char *pattern;
Expand Down
File renamed without changes.
35 changes: 4 additions & 31 deletions tests/Makefile.am
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
## Process this file with automake to produce Makefile.in

#############################
# Icecast integration tests #
#############################

TEST_LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) \
$(top_srcdir)/tap-driver.sh

check_PROGRAMS =

#
# Helper library for TAP tests
#

libice_ctest_la_SOURCES = ctest_lib.c ctest_lib.h
noinst_LTLIBRARIES = libice_ctest.la


#
# Script-based tests
Expand All @@ -22,32 +17,10 @@ TESTS = \
admin.test


#
# Test programs
#

ctest_suite_test_SOURCES = ctest_suite.c
ctest_suite_test_LDADD = libice_ctest.la
check_PROGRAMS += ctest_suite.test

ctest_resourcematch_test_SOURCES = ctest_resourcematch.c
ctest_resourcematch_test_LDADD = libice_ctest.la ../src/icecast-resourcematch.o
check_PROGRAMS += ctest_resourcematch.test

ctest_refobject_test_SOURCES = ctest_refobject.c
ctest_refobject_test_LDADD = libice_ctest.la \
../src/common/thread/libicethread.la \
../src/common/avl/libiceavl.la \
../src/icecast-refobject.o
check_PROGRAMS += ctest_refobject.test


#
# Extra files needed by tests
#

EXTRA_DIST = $(TESTS) \
icecast.xml \
on-connect.sh

TESTS += $(check_PROGRAMS)

0 comments on commit d9793f4

Please sign in to comment.