xref: /aosp_15_r20/external/armnn/src/armnnOnnxParser/test/ProtoxtFixture.cpp (revision 89c4ff92f2867872bb9e2354d150bf0c8c502810)
1 //
2 // Copyright © 2017 Arm Ltd. All rights reserved.
3 // SPDX-License-Identifier: MIT
4 //
5 
6 #include  "armnnOnnxParser/IOnnxParser.hpp"
7 #include  "ParserPrototxtFixture.hpp"
8 
9 TEST_SUITE("OnnxParser_PrototxtFixture")
10 {
11 struct ProtoxtTestFixture : public armnnUtils::ParserPrototxtFixture<armnnOnnxParser::IOnnxParser>
12 {
ProtoxtTestFixtureProtoxtTestFixture13     ProtoxtTestFixture()
14     {
15         m_Prototext = R"(
16                    ir_version: 3
17                    producer_name:  "CNTK "
18                    producer_version:  "2.5.1 "
19                    domain:  "ai.cntk "
20                    model_version: 1
21                    graph {
22                      name:  "CNTKGraph "
23                      node {
24                         input:  "Input"
25                         output:  "Output"
26                         name:  "Plus112"
27                         op_type:  "Add "
28                       }
29                       input {
30                           name:  "Input"
31                           type {
32                             tensor_type {
33                               elem_type: 1
34                               shape {
35                                 dim {
36                                   dim_value: 2
37                                 }
38                               }
39                             }
40                           }
41                       }
42                       output {
43                           name:  "Output"
44                           type {
45                              tensor_type {
46                                elem_type: 1
47                                shape {
48                                  dim {
49                                     dim_value: 1
50                                  }
51                                  dim {
52                                     dim_value: 10
53                                  }
54                                }
55                              }
56                           }
57                       }
58                    }
59                    opset_import {
60                       version: 7
61                     })";
62        // Setup();
63     }
64 };
65 
66 
67 TEST_CASE_FIXTURE(ProtoxtTestFixture, "ProtoxtTest")
68 {
69     //TODO : add a test to check if the inputs and outputs are correctly inferred.
70 }
71 
72 TEST_CASE_FIXTURE(ProtoxtTestFixture, "ProtoxtTestWithBadInputs")
73 {
74 
75    // CHECK_THROWS_AS(RunTest<4>({{ "InexistantInput" , {0.0, 1.0, 2.0, 3.0}}},
76    //                              {{ "InexistantOutput" , {0.0, 1.0, 2.0, 3.0}}}),
77    //                   armnn::InvalidArgumentException );
78 }
79 
80 }
81