~unity-team/unity-lens-video/raring

« back to all changes in this revision

Viewing changes to tests/unit/Makefile.am

  • Committer: Pawel Stolowski
  • Date: 2012-11-09 15:11:21 UTC
  • mto: (101.4.2 video-vala)
  • mto: This revision was merged to the branch mainline in revision 106.
  • Revision ID: pawel.stolowski@canonical.com-20121109151121-bhlwp0mjzotkmbef
More cleanups. Created first unit test.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
include $(top_srcdir)/Makefile.decl
 
2
 
 
3
check_PROGRAMS = \
 
4
        test-locate \
 
5
        $(NULL)
 
6
 
 
7
TEST_PROGS += $(check_PROGRAMS)
 
8
 
 
9
AM_VALAFLAGS = \
 
10
          --pkg dee-1.0 \
 
11
          --pkg unity \
 
12
          --pkg unity-extras \
 
13
          --pkg gio-2.0 \
 
14
          --pkg gio-unix-2.0 \
 
15
          --pkg glib-2.0 \
 
16
          --pkg zeitgeist-1.0 \
 
17
          --vapidir $(srcdir) \
 
18
          --vapidir $(top_srcdir)/vapi \
 
19
          --target-glib=2.26 \
 
20
          $(MAINTAINER_VALAFLAGS) \
 
21
          $(NULL)
 
22
 
 
23
UNITY_PACKAGE_SEARCH_LIBS = -lstdc++
 
24
 
 
25
LDADD = $(LENS_DAEMON_LIBS) \
 
26
        $(test_libs) \
 
27
        $(UNITY_PACKAGE_SEARCH_LIBS)
 
28
 
 
29
AM_CPPFLAGS = \
 
30
  $(LENS_DAEMON_CFLAGS) \
 
31
  -I$(srcdir) \
 
32
  -I$(top_srcdir)/src \
 
33
  $(NULL)
 
34
 
 
35
if !ENABLE_C_WARNINGS
 
36
  AM_CPPFLAGS += -w
 
37
endif
 
38
 
 
39
test_locate_VALASOURCES = \
 
40
        test-locate.vala \
 
41
        thumbnailer-mock.vala \
 
42
        config-tests.vala \
 
43
        $(top_srcdir)/src/locate.vala \
 
44
        $(top_srcdir)/src/utils.vala \
 
45
        $(top_srcdir)/src/video-file.vala \
 
46
        $(NULL)
 
47
 
 
48
nodist_test_locate_SOURCES = $(test_locate_VALASOURCES:.vala=.c)
 
49
 
 
50
CLEANFILES = *.stamp \
 
51
          $(test_locate_VALASOURCES:.vala=.c) \
 
52
          $(NULL)
 
53
 
 
54
BUILT_SOURCES = \
 
55
          test-locate.vala.stamp \
 
56
          $(NULL)
 
57
 
 
58
test-locate.vala.stamp: $(test_locate_VALASOURCES)
 
59
        $(AM_V_GEN)$(VALAC) -C $(AM_VALAFLAGS) $(VALAFLAGS) $^
 
60
        @touch $@
 
61
 
 
62
test-locate: | dummy-videos
 
63
 
 
64
.PHONY: dummy-videos
 
65
dummy-videos:
 
66
        @-mkdir data
 
67
        @for p in $$(seq 1 3); do touch data/video$$p.avi; touch data/video$$p.mpg; done
 
68
 
 
69
# START HEADLESS TESTS
 
70
if ENABLE_HEADLESS_TESTS
 
71
DISPLAY = :27
 
72
LOG_PATH = headless-logs
 
73
test-headless:
 
74
        set -e; \
 
75
        export DISPLAY=$(DISPLAY); \
 
76
        rm -rf $(LOG_PATH); \
 
77
        mkdir $(LOG_PATH); \
 
78
        $(XVFB) $(DISPLAY) -screen 0 1024x768x8 > $(LOG_PATH)/Xvfb.out 2>&1 & \
 
79
        sleep 1; \
 
80
        \
 
81
        make test; \
 
82
        sleep 1; \
 
83
        \
 
84
        pkill Xvfb;
 
85
endif
 
86
# END HEADLESS TESTS