From: Amarnath Valluri Date: Tue, 5 Nov 2013 09:53:18 +0000 (+0200) Subject: examples -> tests X-Git-Tag: accepted/tizen/20131112.202916~8 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=32ff3cd9c74814aaf40ca0378ce87f918d1e3409;p=profile%2Fivi%2Fmessage-port.git examples -> tests --- diff --git a/Makefile.am b/Makefile.am index f72224d..6c57b2f 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,6 +1,6 @@ SUBDIRS = common daemon lib -if BUILD_EXAMPLES - SUBDIRS += examples +if BUILD_TESTS + SUBDIRS += tests endif ACLOCAL_AMFLAGS = -I m4 diff --git a/configure.ac b/configure.ac index 8398194..34b243a 100644 --- a/configure.ac +++ b/configure.ac @@ -64,11 +64,11 @@ if test "x$enable_debug" = "xyes" ; then AC_DEFINE(ENABLE_DEBUG, [1], [Enable debug features]) fi -# build example -AC_ARG_ENABLE(examples, - [ --enable-examples Build example applications], - [enable_examples=$enable_examples], [enable_examples=no]) -AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = "xyes"]) +# build tests +AC_ARG_ENABLE(tests, + [ --enable-tests Build unit tests], + [enable_tests=$enable_tests], [enable_tests=no]) +AM_CONDITIONAL(BUILD_TESTS, [test "x$enable_tests" = "xyes"]) AC_PROG_CXX # Checks for header files. @@ -92,9 +92,9 @@ if test "x$enable_sessionbus" = "xyes"; then ]) fi -if test "x$enable_examples" = "xyes"; then +if test "x$enable_tests" = "xyes"; then AC_OUTPUT([ - examples/Makefile + tests/Makefile ]) fi diff --git a/examples/Makefile.am b/examples/Makefile.am deleted file mode 100644 index e937d78..0000000 --- a/examples/Makefile.am +++ /dev/null @@ -1,11 +0,0 @@ -if BUILD_EXAMPLES -bin_PROGRAMS = msgport-example-app msgport-example-app-cpp - -msgport_example_app_SOURCES = test-app.c -msgport_example_app_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS) $(DLOG_LIBS) -msgport_example_app_CPPFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS) $(DLOG_CFLAGS) - -msgport_example_app_cpp_SOURCES = test-app.cpp -msgport_example_app_cpp_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS) $(DLOG_LIBS) -msgport_example_app_cpp_CXXFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS) $(DLOG_CFLAGS) -endif diff --git a/packaging/message-port.spec b/packaging/message-port.spec index 3bde5d7..a60303a 100644 --- a/packaging/message-port.spec +++ b/packaging/message-port.spec @@ -1,5 +1,5 @@ -%define build_examples 1 +%define build_tests 1 %define use_session_bus 1 Name: message-port Summary: Message port daemon @@ -42,15 +42,15 @@ Requires: lib%{name} = %{version}-%{release} %description -n lib%{name}-devel Development files for message-port client library. -%if %{build_examples} == 1 +%if %{build_tests} == 1 -%package -n %{name}-examples -Summary: Sample code examples for messageport +%package -n %{name}-tests +Summary: Unit tests for messageport Group: Development/Libraries Requires: lib%{name} = %{version}-%{release} -%description -n %{name}-examples -Example applications using message port. +%description -n %{name}-tests +Unit tests for messageport implementation. %endif @@ -63,8 +63,8 @@ autoreconf -f -i %build %configure --enable-debug \ -%if %{build_examples} == 1 - --enable-examples \ +%if %{build_tests} == 1 + --enable-tests\ %endif %if %{use_session_bus} == 1 --enable-sessionbus \ @@ -106,8 +106,8 @@ make %{?_smp_mflags} %{_libdir}/pkgconfig/%{name}.pc %{_includedir}/*.h -%if %{build_examples} == 1 -%files -n %{name}-examples -%{_bindir}/msgport-example-app -%{_bindir}/msgport-example-app-cpp +%if %{build_tests} == 1 +%files -n %{name}-tests +%{_bindir}/msgport-test-app +%{_bindir}/msgport-test-app-cpp %endif diff --git a/tests/Makefile.am b/tests/Makefile.am new file mode 100644 index 0000000..3ffbe52 --- /dev/null +++ b/tests/Makefile.am @@ -0,0 +1,11 @@ +if BUILD_TESTS +bin_PROGRAMS = msgport-test-app msgport-test-app-cpp + +msgport_test_app_SOURCES = test-app.c +msgport_test_app_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS) $(DLOG_LIBS) +msgport_test_app_CPPFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS) $(DLOG_CFLAGS) + +msgport_test_app_cpp_SOURCES = test-app.cpp +msgport_test_app_cpp_LDADD = ../lib/libmessage-port.la $(GLIB_LIBS) $(BUNDLE_LIBS) $(DLOG_LIBS) +msgport_test_app_cpp_CXXFLAGS = -I../lib/ -I ../ $(GLIB_CFLAGS) $(BUNDLE_CFLAGS) $(DLOG_CFLAGS) +endif diff --git a/examples/test-app.c b/tests/test-app.c similarity index 100% rename from examples/test-app.c rename to tests/test-app.c diff --git a/examples/test-app.cpp b/tests/test-app.cpp similarity index 100% rename from examples/test-app.cpp rename to tests/test-app.cpp