Loading tests/lib/Android.bp +14 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,19 @@ // limitations under the License. // java_library { name: "net-tests-utils-multivariant", srcs: [ "multivariant/**/*.java", "multivariant/**/*.kt", ], host_supported: true, static_libs: [ "kotlin-test", "junit", ], } java_library { name: "net-tests-utils", srcs: [ Loading @@ -22,8 +35,7 @@ java_library { ], defaults: ["lib_mockito_extended"], static_libs: [ "kotlin-test", "junit", "net-tests-utils-multivariant", ], } Loading tests/lib/src/com/android/testutils/ConcurrentUtils.kt→tests/lib/multivariant/com/android/testutils/ConcurrentUtils.kt +0 −0 File moved. View file tests/lib/src/com/android/testutils/ExceptionUtils.java→tests/lib/multivariant/com/android/testutils/ExceptionUtils.java +0 −0 File moved. View file tests/lib/src/com/android/testutils/FileUtils.kt→tests/lib/multivariant/com/android/testutils/FileUtils.kt +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 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. */ package com.android.testutils // This function is private because the 2 is hardcoded here, and is not correct if not called Loading tests/lib/src/com/android/testutils/MiscAsserts.kt→tests/lib/multivariant/com/android/testutils/MiscAsserts.kt +0 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.testutils import android.util.Log import com.android.testutils.ExceptionUtils.ThrowingRunnable import java.lang.reflect.Modifier import kotlin.system.measureTimeMillis Loading Loading @@ -80,7 +79,6 @@ fun assertRunsInAtMost(descr: String, timeLimit: Long, fn: Runnable) { fun assertRunsInAtMost(descr: String, timeLimit: Long, fn: () -> Unit) { val timeTaken = measureTimeMillis(fn) val msg = String.format("%s: took %dms, limit was %dms", descr, timeTaken, timeLimit) Log.d(TAG, msg) assertTrue(timeTaken <= timeLimit, msg) } Loading Loading
tests/lib/Android.bp +14 −2 Original line number Diff line number Diff line Loading @@ -14,6 +14,19 @@ // limitations under the License. // java_library { name: "net-tests-utils-multivariant", srcs: [ "multivariant/**/*.java", "multivariant/**/*.kt", ], host_supported: true, static_libs: [ "kotlin-test", "junit", ], } java_library { name: "net-tests-utils", srcs: [ Loading @@ -22,8 +35,7 @@ java_library { ], defaults: ["lib_mockito_extended"], static_libs: [ "kotlin-test", "junit", "net-tests-utils-multivariant", ], } Loading
tests/lib/src/com/android/testutils/ConcurrentUtils.kt→tests/lib/multivariant/com/android/testutils/ConcurrentUtils.kt +0 −0 File moved. View file
tests/lib/src/com/android/testutils/ExceptionUtils.java→tests/lib/multivariant/com/android/testutils/ExceptionUtils.java +0 −0 File moved. View file
tests/lib/src/com/android/testutils/FileUtils.kt→tests/lib/multivariant/com/android/testutils/FileUtils.kt +27 −0 Original line number Diff line number Diff line /* * Copyright (C) 2019 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. */ package com.android.testutils // This function is private because the 2 is hardcoded here, and is not correct if not called Loading
tests/lib/src/com/android/testutils/MiscAsserts.kt→tests/lib/multivariant/com/android/testutils/MiscAsserts.kt +0 −2 Original line number Diff line number Diff line Loading @@ -16,7 +16,6 @@ package com.android.testutils import android.util.Log import com.android.testutils.ExceptionUtils.ThrowingRunnable import java.lang.reflect.Modifier import kotlin.system.measureTimeMillis Loading Loading @@ -80,7 +79,6 @@ fun assertRunsInAtMost(descr: String, timeLimit: Long, fn: Runnable) { fun assertRunsInAtMost(descr: String, timeLimit: Long, fn: () -> Unit) { val timeTaken = measureTimeMillis(fn) val msg = String.format("%s: took %dms, limit was %dms", descr, timeTaken, timeLimit) Log.d(TAG, msg) assertTrue(timeTaken <= timeLimit, msg) } Loading