Add a "unit-tests" sample application to perform unit testing.

This commit is contained in:
David 'Digit' Turner
2009-07-27 12:26:17 +02:00
parent 747294cc4a
commit 4ddb7840c2
9 changed files with 119 additions and 0 deletions

View File

@@ -0,0 +1,17 @@
# Test that LOCAL_CPPFLAGS only works for C++ sources
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_MODULE := test-LOCAL_CPPFLAGS
LOCAL_SRC_FILES := test-LOCAL_CPPFLAGS-1.c \
test-LOCAL_CPPFLAGS-2.cpp \
LOCAL_CFLAGS := -DBANANA=200
# Note, the -UBANANA is only there to prevent a warning
# the test works well without it.
LOCAL_CPPFLAGS := -UBANANA -DBANANA=300
include $(BUILD_SHARED_LIBRARY)

View File

@@ -0,0 +1,10 @@
#if !defined(BANANA)
# error LOCAL_CPPFLAGS does not work for C source file
#endif
#if BANANA != 200
# error LOCAL_CPPFLAGS does not work correctly for C source file
#endif
void __banana_foo1(void)
{
}

View File

@@ -0,0 +1,10 @@
#if !defined(BANANA)
# error LOCAL_CPPFLAGS does not work for C++ source file
#endif
#if BANANA != 300
# error LOCAL_CPPFLAGS does not work correctly for C++ source file
#endif
void __banana_foo2(void)
{
}