Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f36ce923 authored by Justin Klaassen's avatar Justin Klaassen
Browse files

Add android-support-v7-recyclerview dependency

- Also removed obsolete testing files.

Test: tapas ExactCalculator && make -j8
Change-Id: I87e525e978f76ab0ffbd4d9d13789e82f1693247
parent 33aab393
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -21,8 +21,10 @@ LOCAL_RESOURCE_DIR := packages/apps/ExactCalculator/res

ifeq ($(TARGET_BUILD_APPS),)
LOCAL_RESOURCE_DIR += frameworks/support/v7/gridlayout/res
LOCAL_RESOURCE_DIR += frameworks/support/v7/recyclerview/res
else
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/gridlayout/res
LOCAL_RESOURCE_DIR += prebuilts/sdk/current/support/v7/recyclerview/res
endif

LOCAL_MODULE_TAGS := optional
@@ -38,10 +40,10 @@ LOCAL_PROGUARD_FLAG_FILES := proguard.flags
LOCAL_STATIC_JAVA_LIBRARIES := cr
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v4
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-gridlayout
LOCAL_STATIC_JAVA_LIBRARIES += android-support-v7-recyclerview

LOCAL_AAPT_FLAGS := --auto-add-overlay
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.gridlayout
LOCAL_AAPT_FLAGS += --extra-packages android.support.v7.recyclerview

include $(BUILD_PACKAGE)

include $(call all-makefiles-under,$(LOCAL_PATH))

tests/Android.mk

deleted100644 → 0
+0 −13
Original line number Diff line number Diff line
LOCAL_PATH:= $(call my-dir)
include $(CLEAR_VARS)

LOCAL_MODULE_TAGS := tests

LOCAL_PACKAGE_NAME := ExactCalculatorTests
LOCAL_INSTRUMENTATION_FOR := ExactCalculator

LOCAL_SDK_VERSION := current

LOCAL_SRC_FILES := $(call all-java-files-under, src)

include $(BUILD_PACKAGE)

tests/AndroidManifest.xml

deleted100644 → 0
+0 −31
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (C) 2008 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.
-->

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    package="com.android.calculator2.tests">

    <uses-sdk android:minSdkVersion="21" />

    <instrumentation
        android:name="android.test.InstrumentationTestRunner"
        android:targetPackage="com.android.calculator2"
        android:label="BoundedRational and Calculator Functional Test" />

    <application>
        <uses-library android:name="android.test.runner" />
    </application>

</manifest>

tests/README.txt

deleted100644 → 0
+0 −48
Original line number Diff line number Diff line
Run on Android with

1) Build the tests.
2) Install the calculator with
adb install <tree root>/out/target/product/generic/data/app/ExactCalculator/ExactCalculator.apk
3) adb install <tree root>/out/target/product/generic/data/app/ExactCalculatorTests/ExactCalculatorTests.apk
4) adb shell am instrument -w com.android.calculator2.tests/android.test.InstrumentationTestRunner

There are three kinds of tests:

1. A superficial test of calculator functionality through the UI.
This is a resurrected version of a test that appeared in KitKat.
This is currently only a placeholder for regression tests we shouldn't
forget; it doesn't yet actually do much of anything.

2. A test of the BoundedRationals library that mostly checks for agreement
with the constructive reals (CR) package.  (The BoundedRationals package
is used by the calculator mostly to identify exact results, i.e.
terminating decimal expansions.  But it's also used to optimize CR
computations, and bugs in BoundedRational could result in incorrect
outputs.)

3. A quick test of Evaluator.testUnflipZeroes(), which we do not know how to
test manually.

We currently have no automatic tests for display formatting corner cases.
The following numbers have exhibited problems in the past and would be good
to test.  Some of them are difficult to test automatically, because they
require scrolling to both ends of the result.  For those with finite
decimal expansions, it also worth confirming that the "display with leading
digits" display shows an exact value when scrolled all the way to the right.

Some interesting manual test cases:

10^10 + 10^30
10^30 + 10^-10
-10^30 + 20
10^30 + 10^-30
-10^30 - 10^10
-1.2x10^-9
-1.2x10^-8
-1.2x10^-10
-10^-12
1 - 10^-98
1 - 10^-100
1 - 10^-300
1/-56x10^18 (on a Nexus 7 sized portrait display)
-10^-500 (scroll to see the 1, then scroll back & verify minus sign appears)