Browse Source

integrate AES unit test into main build framework

Required addition of include/ directory for headers shared between
daemon and tests

Change-Id: Ib25504f4d7f4baa917efcdc0ef78b6cc89439827
pull/545/head
Richard Fuchs 8 years ago
parent
commit
db2882ca78
19 changed files with 30 additions and 54 deletions
  1. +1
    -1
      daemon/Makefile
  2. +0
    -0
      include/aux.h
  3. +0
    -0
      include/bencode.h
  4. +0
    -0
      include/call.h
  5. +0
    -0
      include/crypto.h
  6. +1
    -0
      include/dtls.h
  7. +0
    -0
      include/media_socket.h
  8. +0
    -0
      include/obj.h
  9. +0
    -0
      include/recording.h
  10. +0
    -0
      include/rtcp.h
  11. +0
    -0
      include/rtp.h
  12. +0
    -0
      include/socket.h
  13. +0
    -0
      include/statistics.h
  14. +8
    -3
      lib/common.Makefile
  15. +2
    -0
      t/.gitignore
  16. +1
    -0
      t/.ycm_extra_conf.py
  17. +11
    -6
      t/Makefile
  18. +6
    -6
      t/aes-crypt.c
  19. +0
    -38
      tests/Makefile.aes

+ 1
- 1
daemon/Makefile View File

@ -60,7 +60,7 @@ ifeq ($(with_iptables_option),yes)
CFLAGS+= $(shell pkg-config --cflags libiptc)
CFLAGS+= -DWITH_IPTABLES_OPTION
endif
CFLAGS+= -I. -I../kernel-module/ -I../lib/
CFLAGS+= -I. -I../kernel-module/ -I../lib/ -I../include/
CFLAGS+= -D_GNU_SOURCE
ifeq ($(with_transcoding),yes)
CFLAGS+= $(shell pkg-config --cflags libavcodec)


daemon/aux.h → include/aux.h View File


daemon/bencode.h → include/bencode.h View File


daemon/call.h → include/call.h View File


daemon/crypto.h → include/crypto.h View File


daemon/dtls.h → include/dtls.h View File


daemon/media_socket.h → include/media_socket.h View File


daemon/obj.h → include/obj.h View File


daemon/recording.h → include/recording.h View File


daemon/rtcp.h → include/rtcp.h View File


daemon/rtp.h → include/rtp.h View File


daemon/socket.h → include/socket.h View File


daemon/statistics.h → include/statistics.h View File


+ 8
- 3
lib/common.Makefile View File

@ -12,11 +12,11 @@ debug:
dep: .depend
clean:
rm -f $(OBJS) $(TARGET) $(LIBSRCS) $(ADD_CLEAN) .depend core core.*
rm -f $(OBJS) $(TARGET) $(LIBSRCS) $(DAEMONSRCS) $(ADD_CLEAN) .depend core core.*
rm -f fix_frame_channel_layout.h fix_frame_channel_layout-test.[co]
.depend: $(SRCS) $(LIBSRCS) Makefile
$(CC) $(CFLAGS) -M $(SRCS) $(LIBSRCS) | sed -e 's/:/ .depend:/' > .depend
.depend: $(SRCS) $(LIBSRCS) $(DAEMONSRCS) Makefile
$(CC) $(CFLAGS) -M $(SRCS) $(LIBSRCS) $(DAEMONSRCS) | sed -e 's/:/ .depend:/' > .depend
install:
@ -27,6 +27,11 @@ $(LIBSRCS): $(patsubst %,../lib/%,$(LIBSRCS))
echo '/******** GENERATED FILE ********/' > "$@"
cat ../lib/"$@" >> "$@"
$(DAEMONSRCS): $(patsubst %,../daemon/%,$(DAEMONSRCS))
rm -f "$@"
echo '/******** GENERATED FILE ********/' > "$@"
cat ../daemon/"$@" >> "$@"
resample.c: fix_frame_channel_layout.h
fix_frame_channel_layout.h: ../lib/fix_frame_channel_layout-*


+ 2
- 0
t/.gitignore View File

@ -11,3 +11,5 @@ loglib.c
resample.c
rtplib.c
str.c
crypto.c
aes-crypt

+ 1
- 0
t/.ycm_extra_conf.py View File

@ -22,6 +22,7 @@ flags = [
'-pthread',
'-I../kernel-module/',
'-I../lib/',
'-I../daemon/',
'-D_GNU_SOURCE',
'-D__DEBUG=1',
'-D__YCM=1',


+ 11
- 6
t/Makefile View File

@ -7,7 +7,7 @@ CFLAGS+= -std=c99
CFLAGS+= $(shell pkg-config --cflags glib-2.0)
CFLAGS+= $(shell pkg-config --cflags gthread-2.0)
CFLAGS+= $(shell pkg-config --cflags openssl)
CFLAGS+= -I. -I../lib/
CFLAGS+= -I. -I../lib/ -I../kernel-module/ -I../include/
CFLAGS+= -D_GNU_SOURCE
ifeq ($(with_transcoding),yes)
CFLAGS+= $(shell pkg-config --cflags libavcodec)
@ -32,7 +32,7 @@ LDLIBS+= $(shell pkg-config --libs libswresample)
LDLIBS+= $(shell pkg-config --libs libavfilter)
endif
SRCS= bitstr-test.c
SRCS= bitstr-test.c aes-crypt.c
ifeq ($(with_transcoding),yes)
SRCS+= amr-decode-test.c amr-encode-test.c
endif
@ -40,7 +40,10 @@ LIBSRCS= loglib.c auxlib.c str.c rtplib.c
ifeq ($(with_transcoding),yes)
LIBSRCS+= codeclib.c resample.c
endif
OBJS= $(SRCS:.c=.o) $(LIBSRCS:.c=.o)
DAEMONSRCS= crypto.c
OBJS= $(SRCS:.c=.o) $(LIBSRCS:.c=.o) $(DAEMONSRCS:.c=.o)
COMMONOBJS= str.o auxlib.o rtplib.o loglib.o
include ../lib/common.Makefile
@ -48,7 +51,7 @@ include .depend
.PHONY: unit-tests
TESTS= bitstr-test
TESTS= bitstr-test aes-crypt
ifeq ($(with_transcoding),yes)
TESTS+= amr-decode-test amr-encode-test
endif
@ -60,6 +63,8 @@ unit-tests: $(TESTS)
bitstr-test: bitstr-test.o
amr-decode-test: amr-decode-test.o codeclib.o str.o auxlib.o resample.o rtplib.o loglib.o
amr-decode-test: amr-decode-test.o $(COMMONOBJS) codeclib.o resample.o
amr-encode-test: amr-encode-test.o $(COMMONOBJS) codeclib.o resample.o
amr-encode-test: amr-encode-test.o codeclib.o str.o auxlib.o resample.o rtplib.o loglib.o
aes-crypt: aes-crypt.o $(COMMONOBJS) crypto.o

tests/t_crypt.c → t/aes-crypt.c View File


+ 0
- 38
tests/Makefile.aes View File

@ -1,38 +0,0 @@
##
## Build daemon/
## cd tests/
## make -f Makefile.aes, output is binary t_crypt
## run: ./t_crypt
CC = gcc
CPPFLAGS = -I../daemon -I../lib
OBJS_DIR = ../daemon/
OBJS = crypto.o log.o loglib.o
LDLIBS = $(shell pkg-config --libs glib-2.0)
LDLIBS += $(shell pkg-config --libs openssl)
CFLAGS = -g $(shell pkg-config --cflags glib-2.0) -D_GNU_SOURCE
%.d: %.c
@set -e; rm -f $@; \
$(CC) -M $(CPPFLAGS) $(shell pkg-config --cflags glib-2.0) -D_GNU_SOURCE $< > $@.$$$$; \
sed 's,\($*\)\.o[ :]*,\1.o $@ : ,g' < $@.$$$$ > $@; \
rm -f $@.$$$$
all: t_crypt
sources = t_crypt.c
include $(sources:.c=.d)
t_crypt: t_crypt.o
gcc $(LDFLAGS) -o $@ $< $(addprefix $(OBJS_DIR), $(OBJS)) $(LDLIBS)
.PHONY: clean
clean:
-rm -f t_crypt t_crypt.o

Loading…
Cancel
Save