am c52e54c4: Merge "Some more test cleanup."

* commit 'c52e54c47184704613d446eb15d051ceb43d82b3':
  Some more test cleanup.
This commit is contained in:
Dan Albert 2014-10-17 17:53:10 +00:00 committed by Android Git Automerger
commit 3235d8e477
2 changed files with 36 additions and 30 deletions

View File

@ -1,31 +1,36 @@
# Build the unit tests.
#
# Copyright (C) 2014 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SHARED_LIBRARIES := libui
LOCAL_SRC_FILES := Region_test.cpp
LOCAL_MODULE := Region_test
include $(BUILD_NATIVE_TEST)
# Build the unit tests.
test_src_files := \
Region_test.cpp \
vec_test.cpp \
mat_test.cpp
include $(CLEAR_VARS)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SRC_FILES := vec_test.cpp
LOCAL_MODULE := vec_test
include $(BUILD_NATIVE_TEST)
shared_libraries := \
libutils \
libui
static_libraries := \
libgtest \
libgtest_main
$(foreach file,$(test_src_files), \
$(eval include $(CLEAR_VARS)) \
$(eval LOCAL_SHARED_LIBRARIES := $(shared_libraries)) \
$(eval LOCAL_STATIC_LIBRARIES := $(static_libraries)) \
$(eval LOCAL_SRC_FILES := $(file)) \
$(eval LOCAL_MODULE := $(notdir $(file:%.cpp=%))) \
$(eval include $(BUILD_NATIVE_TEST)) \
)
# Build the unit tests.
# Build the manual test programs.
include $(call all-makefiles-under, $(LOCAL_PATH))
include $(CLEAR_VARS)
LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
LOCAL_SRC_FILES := mat_test.cpp
LOCAL_MODULE := mat_test
include $(BUILD_NATIVE_TEST)

View File

@ -16,17 +16,18 @@
#define LOG_TAG "RegionTest"
#include <math.h>
#include <stdlib.h>
#include <ui/Region.h>
#include <ui/Rect.h>
#include <gtest/gtest.h>
#include <ui/vec4.h>
#include <gtest/gtest.h>
namespace android {
class VecTest : public testing::Test {
protected:
};
TEST_F(VecTest, Basics) {