summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMika Raento <mikie@google.com>2018-05-11 12:47:54 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2018-05-11 12:47:54 +0000
commit40ac90985a927ff77d234c4d4fc33ab0a9a85648 (patch)
tree7eef419ce0825e41139ac05a69999148b92ec0f3
parent4d4389e0a9f8b43131289dd9e95c58a270b47114 (diff)
parent8af4cd092bd233e920ac8203ba62da2234edebc9 (diff)
downloadml-40ac90985a927ff77d234c4d4fc33ab0a9a85648.tar.gz
Merge "Fix tests that are to only use public API to do so" into pi-dev
-rw-r--r--nn/runtime/test/Android.bp21
-rw-r--r--nn/runtime/test/TestMain.cpp7
2 files changed, 16 insertions, 12 deletions
diff --git a/nn/runtime/test/Android.bp b/nn/runtime/test/Android.bp
index bada2f41f..deb240b06 100644
--- a/nn/runtime/test/Android.bp
+++ b/nn/runtime/test/Android.bp
@@ -21,10 +21,11 @@ cc_defaults {
openmp: true,
srcs: [
// Subset of tests that rely only on public functionality.
- "Bridge.cpp",
+ //
+ // Changes to this list must be reflected in cts/tests/tests/neuralnetworks/Android.mk
+ // to ensure CTS tests coverage.
"TestGenerated.cpp",
"TestMemory.cpp",
- "TestMemoryInternal.cpp",
"TestTrivialModel.cpp",
"TestUnknownDimensions.cpp",
"TestValidateOperations.cpp",
@@ -45,12 +46,7 @@ cc_defaults {
"android.hidl.allocator@1.0",
"android.hidl.memory@1.0",
],
- static_libs: [
- "libneuralnetworks_common",
- "libSampleDriver",
- ],
header_libs: [
- "libneuralnetworks_private_headers",
"libneuralnetworks_generated_test_harness_headers",
],
}
@@ -68,9 +64,6 @@ cc_test {
"libneuralnetworks",
"libtextclassifier_hash",
],
- static_libs: [
- "libneuralnetworks_common",
- ],
}
cc_test {
@@ -79,17 +72,23 @@ cc_test {
srcs: [
"TestMain.cpp",
+ "Bridge.cpp",
// Tests that rely on non-public functionality (i.e., symbols
// not exported from libneuralnetworks.so).
"TestExecution.cpp",
+ "TestMemoryInternal.cpp",
"TestPartitioning.cpp",
"TestPartitioningRandom.cpp",
],
static_libs: [
"libneuralnetworks",
"libneuralnetworks_common",
+ "libSampleDriver",
],
shared_libs: [
"libcutils",
- ]
+ ],
+ header_libs: [
+ "libneuralnetworks_private_headers",
+ ],
}
diff --git a/nn/runtime/test/TestMain.cpp b/nn/runtime/test/TestMain.cpp
index 7409c9376..01c733d20 100644
--- a/nn/runtime/test/TestMain.cpp
+++ b/nn/runtime/test/TestMain.cpp
@@ -14,9 +14,12 @@
* limitations under the License.
*/
-#include "Manager.h"
#include "NeuralNetworksWrapper.h"
+
+#ifndef NNTEST_ONLY_PUBLIC_API
+#include "Manager.h"
#include "Utils.h"
+#endif
#include <gtest/gtest.h>
@@ -25,7 +28,9 @@ using namespace android::nn::wrapper;
int main(int argc, char** argv) {
::testing::InitGoogleTest(&argc, argv);
+#ifndef NNTEST_ONLY_PUBLIC_API
android::nn::initVLogMask();
+#endif
// Test with the installed drivers.
int n1 = RUN_ALL_TESTS();
#ifdef NNTEST_ONLY_PUBLIC_API