Changeset 1256

Show
Ignore:
Timestamp:
11/27/06 00:28:27
Author:
pvanhoof
Message:

Added an API test

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/ChangeLog

    r1255 r1256  
     12006-11-27  Øystein Gisnås <oystein@gisnas.net> 
     2 
     3        * Added an API testing unit test 
     4 
    152006-11-26  muppet <scott@asofyet.org> 
    26 
  • trunk/README

    r1237 r1256  
    3333  export LD_LIBRARY_PATH=./libtinymail-test/.libs/ 
    3434  gunit-test-runner-tool -s tinymail-test-suite -v gnome 
     35 
     36API tests are unit tests that test only the public interface of tinymail. 
     37Instead of testing the current source, it will test the tinymail libraries 
     38currently installed on the system. Enable API tests with --enable-api-tests. 
     39Tinymail .pc files must be found by pkg-config when using this flag. 
     40 
     41API test usage 
     42  export LD_LIBRARY_PATH=./libtinymail-test/.libs/ 
     43  gunit-test-runner-tool -s tinymail-api-test-suite -v gnome 
    3544 
    3645Building tips 
  • trunk/configure.ac

    r1183 r1256  
    170170AM_CONDITIONAL(BUILD_GNOME, test x$build_gnome = xtrue) 
    171171 
     172dnl ### Enable building the API tests ## 
     173AC_ARG_ENABLE(api-tests, 
     174AC_HELP_STRING([--enable-api-tests], 
     175  [Build API tests (no, yes)]), 
     176[case "${enableval}" in 
     177  yes)  
     178        build_apitests=true  
     179        build_unittests=true  
     180  ;; 
     181  no)  build_apitests=false ;; 
     182  *) AC_MSG_ERROR(bad value ${enableval} for --enable-api-tests) ;; 
     183esac],[build_apitests=$build_apitests]) 
     184AM_CONDITIONAL(BUILD_APITESTS, test x$build_apitests = xtrue) 
     185 
    172186dnl ### Enable building the unit tests ## 
    173187AC_ARG_ENABLE(unit-tests, 
     
    341355AC_SUBST(LIBTINYMAIL_TEST_CFLAGS) 
    342356AC_SUBST(LIBTINYMAIL_TEST_LIBS) 
     357 
     358dnl ### libtinymail-api-test, a library for testing API/ABI compatibility ## 
     359if test x$build_apitests = xtrue; then 
     360  PKG_CHECK_MODULES(LIBTINYMAIL_API_TEST, gunit glib-2.0 >= 2.6 gobject-2.0 libtinymail-1.0 libtinymail-camel-1.0 libtinymailui-gtk-1.0 camel-lite-1.2) 
     361else 
     362  LIBTINYMAIL_API_TEST_CFLAGS= 
     363  LIBTINYMAIL_API_TEST_LIBS= 
     364fi 
     365AC_SUBST(LIBTINYMAIL_API_TEST_CFLAGS) 
     366AC_SUBST(LIBTINYMAIL_API_TEST_LIBS) 
    343367 
    344368dnl ### tinymail, the demo-ui ## 
     
    416440echo "  HTML component:              ${with_html_component}" 
    417441echo "  Python language bindings:    $build_pytinymail" 
     442echo "  API tests:                   $build_apitests" 
    418443echo "  Unit tests:                  $build_unittests" 
    419444echo "  Tests:                       $build_tests" 
  • trunk/libtinymail-test

    • Property svn:ignore changed from Makefile.in .deps Makefile tny-simple-test-runner tny-test-anything .libs to Makefile.in .deps Makefile tny-simple-test-runner tny-test-anything .libs tny-simple-api-test-runner
  • trunk/libtinymail-test/.svnignore

    r553 r1256  
    55tny-test-anything 
    66.libs 
     7tny-simple-api-test-runner 
  • trunk/libtinymail-test/Makefile.am

    r1028 r1256  
    1717 
    1818bin_PROGRAMS = tny-simple-test-runner tny-test-anything 
     19 
     20if BUILD_APITESTS 
     21lib_LTLIBRARIES += libtinymail-api-test-suite.la 
     22bin_PROGRAMS += tny-simple-api-test-runner 
     23endif 
    1924 
    2025libtinymail_test_suite_la_SOURCES = \ 
     
    9297        libtinymail-test-suite.la 
    9398 
     99# API test suite 
     100 
     101libtinymail_api_test_suite_la_SOURCES = \ 
     102        tny-api-test-suite.c \ 
     103        tny-list-test.c \ 
     104        tny-device-test.c \ 
     105        tny-account-test.c \ 
     106        tny-folder-test.c \ 
     107        tny-mime-part-test.c \ 
     108        tny-test-stream.c \ 
     109        tny-header-test.c \ 
     110        tny-folder-store-query-test.c \ 
     111        tny-account-store-test.c \ 
     112        tny-platform-factory-test.c \ 
     113        tny-test-object.c 
     114 
     115libtinymail_api_test_suite_la_CFLAGS = -fPIC \ 
     116        $(LIBTINYMAIL_API_TEST_CFLAGS) 
     117 
     118libtinymail_api_test_suite_la_LDFLAGS = $(LIBTINYMAIL_API_TEST_LIBS) \ 
     119        -export-dynamic -version-info $(LT_VERSION_INFO) \ 
     120        $(LIBTOOL_EXPORT_OPTIONS) 
     121 
     122# API test runner 
     123 
     124tny_simple_api_test_runner_SOURCES = tny-simple-api-test-runner.c 
     125 
     126tny_simple_api_test_runner_CFLAGS = $(LIBTINYMAIL_API_TEST_CFLAGS) 
     127 
     128tny_simple_api_test_runner_LDADD = \ 
     129        libtinymail-api-test-suite.la \ 
     130        $(top_builddir)/tests/shared/libtestsshared.a