summaryrefslogtreecommitdiff
path: root/nn/runtime/test/fuzzing
diff options
context:
space:
mode:
authorXusong Wang <xusongw@google.com>2019-08-02 15:25:50 -0700
committerXusong Wang <xusongw@google.com>2019-08-26 15:12:04 -0700
commit9b18dabff0d06b43884066c8ac446aa0417b4c45 (patch)
tree0d347f5b5d1594f1a86a4a3ed38e1cb08bb3af71 /nn/runtime/test/fuzzing
parent5b7fa79377f0d5da8e6514a049af8caa67577c6d (diff)
downloadml-9b18dabff0d06b43884066c8ac446aa0417b4c45.tar.gz
Defines an unified test model struct.
This CL * Defines an unified test model struct that both CTS and VTS can understand. * Implements helper function checking the results. * Makes TestHarness a static library. Also defines a filegroup because CTS cannot have non-NDK library. Having a unified test model struct leads to the following benefits: * Less compilation time. * Easier to implement mutation tests at CTS level. * Better extensibility. Easier to use the generated models in other tests. Bug: 120601396 Bug: 138718240 Test: NNT_static Test: CTS Test: All 1.x and 1.x-compat-1.y VTS Change-Id: Ic2aa426ab6592678780f845359aba221154b4206 Merged-In: Ic2aa426ab6592678780f845359aba221154b4206 (cherry picked from commit b749013703617463d3b56ab6c4603d4a8a595474)
Diffstat (limited to 'nn/runtime/test/fuzzing')
-rw-r--r--nn/runtime/test/fuzzing/RandomGraphGenerator.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/nn/runtime/test/fuzzing/RandomGraphGenerator.cpp b/nn/runtime/test/fuzzing/RandomGraphGenerator.cpp
index 6c21b7eea..0e82dc143 100644
--- a/nn/runtime/test/fuzzing/RandomGraphGenerator.cpp
+++ b/nn/runtime/test/fuzzing/RandomGraphGenerator.cpp
@@ -18,7 +18,10 @@
#include <gtest/gtest.h>
+#include <algorithm>
#include <cmath>
+#include <memory>
+#include <set>
#include <string>
#include <unordered_map>
#include <vector>
@@ -342,6 +345,8 @@ void expectBooleanNearlyEqual(const RandomOperand& op, const OperandBuffer& test
EXPECT_LE(numErrors, allowedErrorCount) << errorMsg.str();
}
+// TODO(b/139442221): Reduce code duplication with
+// nn/tools/test_generator/test_harness/TestHarness.cpp.
void RandomGraph::checkResults(const std::vector<OperandBuffer>& buffers,
const AccuracyCriteria& criteria) const {
NN_FUZZER_LOG << "Check Results";