2009-06-01 Jeffrey Stedfast <fejj@novell.com>
[moon.git] / m4 / testing.m4
blobce57d9c12d7ecf195b3fd3a78a22985800b9f247
1 AC_DEFUN([TEST_CHECK_MODULES],
3         if test x$with_testing = xyes; then
4                 PKG_CHECK_MODULES($1, $2, [], [
5                         with_testing=no
6                         if test x"$3" = "x"; then
7                                 testing_reason="(reason: failed to find $2)"
8                         else
9                                 testing_reason="(reason: $3)"
10                         fi
11                 ])
12         fi
15 AC_DEFUN([MOONLIGHT_CHECK_TESTING],
17         dnl
18         dnl test suite
19         dnl
20         
21         AC_ARG_WITH(testing, [  --with-testing=yes|no      Enable unit tests (defaults=yes)],[],[with_testing=yes])
23         if test x$with_testing = xyes; then
25                 if test x$with_ff3 = xyes; then
26                         TEST_CHECK_MODULES(XULRUNNER, [mozilla-gtkmozembed mozilla-js], 
27                                 [failed to find FF3 development packages])
28                 elif test x$with_ff2 = xyes; then
29                         TEST_CHECK_MODULES(XULRUNNER, [xulrunner-gtkmozembed], 
30                                 [failed to find FF2 development packages])
31                 fi
32         else
33         testing_reason="(reason: disabled by user)"
34     fi
36         TEST_CHECK_MODULES(XTST, [xtst >= 1.0])
37         TEST_CHECK_MODULES(IMAGEMAGICK, [ImageMagick++ >= 6.2.5])
39         AM_CONDITIONAL(INCLUDE_TESTING, test x$with_testing = xyes)
41         dnl
42         dnl performance suite
43         dnl
45         AC_ARG_WITH(performance, [  --with-performance=yes|no      Enable performance tests (defaults=yes)],[],[with_performance=yes])
47         if test x$with_performance = xyes; then
49                 if test x$with_ff3 = xyes; then
50                         PKG_CHECK_MODULES(XULRUNNER, [mozilla-gtkmozembed mozilla-js], [], [
51                                 with_performance=no
52                                 performance-reason="(reason: failed to find FF3 development packages)"
53                         ])
54                 else
55                         with_performance=no
56                         performance_reason="(reason: performance suite requires FF3)"
57                 fi
58     else
59         performance_reason="(reason: disabled by user)"
60         fi
62         AM_CONDITIONAL(INCLUDE_PERFORMANCE,test x$with_performance = xyes)
64         dnl Look to see if the MS tests are installed
65         MS_DRTLIST=none
66         if test -f $PWD/../moonlight-ms/tests/port/drop1030/built/drtlist.xml; then
67                 MS_DRTLIST=$PWD/../moonlight-ms/tests/port/drop1030/built/drtlist.xml
68                 AC_SUBST(MS_DRTLIST)
69         elif test -f $PWD/../../extras/moonlight-ms/tests/port/drop1030/built/drtlist.xml; then
70                 MS_DRTLIST=$PWD/../../extras/moonlight-ms/tests/port/drop1030/built/drtlist.xml
71                 AC_SUBST(MS_DRTLIST)
72         fi