summaryrefslogtreecommitdiffstats
path: root/libs/ui
diff options
context:
space:
mode:
authorDan Albert <danalbert@google.com>2014-10-16 20:46:05 -0700
committerDan Albert <danalbert@google.com>2014-10-16 20:46:05 -0700
commited7d193ae95ce72a014c8ba1ab177f3abf958765 (patch)
tree5eb2d5e54d81088efd62085d2e9c2ce33375664c /libs/ui
parente9034b4502ae6e693ad52fe2e435066dc969a3ab (diff)
downloadframeworks_native-ed7d193ae95ce72a014c8ba1ab177f3abf958765.zip
frameworks_native-ed7d193ae95ce72a014c8ba1ab177f3abf958765.tar.gz
frameworks_native-ed7d193ae95ce72a014c8ba1ab177f3abf958765.tar.bz2
Some more test cleanup.
Needed to build successfully when libc++ is the default STL. Also fix a missing include. Not sure how this was getting by before. Probably some transitive include. Change-Id: Ie96b79e96b4e154d786fbf2d5ae5cf5892608837
Diffstat (limited to 'libs/ui')
-rw-r--r--libs/ui/tests/Android.mk59
-rw-r--r--libs/ui/tests/vec_test.cpp7
2 files changed, 36 insertions, 30 deletions
diff --git a/libs/ui/tests/Android.mk b/libs/ui/tests/Android.mk
index b0c57db..6438b1f 100644
--- a/libs/ui/tests/Android.mk
+++ b/libs/ui/tests/Android.mk
@@ -1,31 +1,36 @@
-# Build the unit tests.
-LOCAL_PATH := $(call my-dir)
-include $(CLEAR_VARS)
-
-# Build the unit tests.
-test_src_files := \
- Region_test.cpp \
- vec_test.cpp \
- mat_test.cpp
-
-shared_libraries := \
- libutils \
- libui
+#
+# 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.
+#
-static_libraries := \
- libgtest \
- libgtest_main
+LOCAL_PATH := $(call my-dir)
-$(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)) \
-)
+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.
+include $(CLEAR_VARS)
+LOCAL_ADDITIONAL_DEPENDENCIES := $(LOCAL_PATH)/Android.mk
+LOCAL_SRC_FILES := vec_test.cpp
+LOCAL_MODULE := vec_test
+include $(BUILD_NATIVE_TEST)
-# 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)
diff --git a/libs/ui/tests/vec_test.cpp b/libs/ui/tests/vec_test.cpp
index 00f737e..454c999 100644
--- a/libs/ui/tests/vec_test.cpp
+++ b/libs/ui/tests/vec_test.cpp
@@ -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) {