Skip to content
Browse files

Moved unittests to separate makefile

  • Loading branch information...
1 parent ef4e819 commit 6c58702e5031ffe1259768082fc7eacb1d42705a @jaytaph jaytaph committed Jul 12, 2013
Showing with 57 additions and 28 deletions.
  1. +1 −1 Makefile.am
  2. +1 −0 configure.in
  3. +1 −27 src/Makefile.am
  4. +54 −0 unittests/core/Makefile.am
  5. 0 unittests/core/{main.c → utmain.c}
View
2 Makefile.am
@@ -1,3 +1,3 @@
-SUBDIRS = src
+SUBDIRS = src unittests/core
EXTRA_DIST = autogen.sh
View
1 configure.in
@@ -141,6 +141,7 @@ AC_CHECK_FUNCS([floor memset strdup strtol])
AC_CONFIG_FILES([
Makefile
src/Makefile
+ unittests/core/Makefile
])
AC_OUTPUT
View
28 src/Makefile.am
@@ -217,6 +217,7 @@ libgc_a_SOURCES = components/gc/gc.c
# main/saffire
########################################################################
+# There are double archives here, this is because of resolving of objects.
SAFFIRE_LIBS = \
libobjects.a \
libgeneral.a \
@@ -227,7 +228,6 @@ SAFFIRE_LIBS = \
librepl.a \
libvm.a \
libgc.a \
- libgeneral.a \
libmodules.a \
libdebugger.a
@@ -240,29 +240,3 @@ saffire_SOURCES = main/saffire.c \
main/commands/config.c main/commands/fastcgi.c main/commands/lint.c \
main/commands/exec.c main/commands/repl.c main/commands/help.c \
main/commands/version.c main/commands/bytecode.c
-
-
-
-########################################################################
-# ../unittests/core
-########################################################################
-
-noinst_LIBRARIES += libtests.a
-libtests_a_SOURCES = ../unittests/core/main.c
-
-########################################################################
-# unittests
-########################################################################
-
-TESTS = utmain
-check_PROGRAMS = utmain
-
-utmain_LDADD = $(SAFFIRE_LIBS) $(SAFFIRE_LIBS) $(edit_LIBS) ${libxml2_LIBS} -lpthread -lcunit
-
-utmain_SOURCES = \
- ../unittests/core/main.c \
- ../unittests/core/hashtable/hashtable.c \
- ../unittests/core/dll/dll.c \
- ../unittests/core/bz2/bz2.c \
- ../unittests/core/ini/ini.c
-
View
54 unittests/core/Makefile.am
@@ -0,0 +1,54 @@
+# Complain about everything, except unused functions
+AM_CFLAGS = -Wall -Wno-unused-function
+
+LIB_DIR = ../../src
+
+# Add GNUSOURCE define to ignore warning for aprintf
+AM_CFLAGS += -D_GNU_SOURCE
+AM_CFLAGS += -I../../src/include
+
+# There are double archives here, this is because of resolving of objects.
+SAFFIRE_LIBS = \
+ ${LIB_DIR}/libobjects.a \
+ ${LIB_DIR}/libgeneral.a \
+ ${LIB_DIR}/libobjects.a \
+ ${LIB_DIR}/libgeneral.a \
+ ${LIB_DIR}/libcompiler.a \
+ ${LIB_DIR}/libfastcgi.a \
+ ${LIB_DIR}/librepl.a \
+ ${LIB_DIR}/libvm.a \
+ ${LIB_DIR}/libcompiler.a \
+ ${LIB_DIR}/libgc.a \
+ ${LIB_DIR}/libgeneral.a \
+ ${LIB_DIR}/libmodules.a \
+ ${LIB_DIR}/libdebugger.a \
+ ${LIB_DIR}/libgeneral.a
+
+
+########################################################################
+# ../unittests/core
+########################################################################
+
+noinst_LIBRARIES = libtests.a
+libtests_a_SOURCES = utmain.c
+
+
+########################################################################
+# unittests
+########################################################################
+
+
+bin_PROGRAMS =
+
+TESTS = utmain
+check_PROGRAMS = utmain
+
+utmain_LDADD = $(SAFFIRE_LIBS) ${libxml2_LIBS} -lpthread -lcunit
+
+utmain_SOURCES = \
+ utmain.c \
+ hashtable/hashtable.c \
+ dll/dll.c \
+ bz2/bz2.c \
+ ini/ini.c
+
View
0 unittests/core/main.c → unittests/core/utmain.c
File renamed without changes.

0 comments on commit 6c58702

Please sign in to comment.
Something went wrong with that request. Please try again.