2 * Copyright (c) 2019 Samsung Electronics Co., Ltd All Rights Reserved
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License
18 using Log = Tizen.Log;
20 using Tizen.MachineLearning.Inference.Test;
22 namespace XamarinForTizen.Tizen
24 public class App : Application
28 Button btnTensorsInfo;
34 btnPipeline = new Button
36 Text = "Pipeline Test",
37 HorizontalOptions = LayoutOptions.FillAndExpand,
38 VerticalOptions = LayoutOptions.StartAndExpand,
40 btnPipeline.Clicked += OnBtnPilelineClicked;
42 btnSingle = new Button
45 HorizontalOptions = LayoutOptions.FillAndExpand,
46 VerticalOptions = LayoutOptions.StartAndExpand,
48 btnSingle.Clicked += OnBtnSingleClicked;
50 btnTensorsInfo = new Button
52 Text = "TensorsInfo Test",
53 HorizontalOptions = LayoutOptions.FillAndExpand,
54 VerticalOptions = LayoutOptions.StartAndExpand,
56 btnTensorsInfo.Clicked += OnBtnTensorsInfoClicked;
61 HorizontalOptions = LayoutOptions.FillAndExpand,
63 // The root page of your application
64 MainPage = new ContentPage
66 Content = new StackLayout
68 VerticalOptions = LayoutOptions.Start,
79 protected override void OnStart()
81 // Handle when your app starts
84 protected override void OnSleep()
86 // Handle when your app sleeps
89 protected override void OnResume()
91 // Handle when your app resumes
94 private void OnBtnPilelineClicked(object s, EventArgs e)
97 retMsg += "Pipeline Test Started\n\n";
99 retMsg += "\nPipeline Test Done";
101 lblResult.Text = retMsg;
104 private void OnBtnSingleClicked(object s, EventArgs e)
106 string msg = "Single Test Started\n";
108 msg += " * BasicSingleTest_Success00: ";
109 msg += SingleShotTest.BasicSingleTest_Success00() ? "OK\n" : "Failed\n";
111 msg += "Single Test is Done\n";
113 lblResult.Text = msg;
116 private void OnBtnTensorsInfoClicked(object s, EventArgs e)
118 string msg = "TensorsInfo Test Started\n";
120 msg += " * BasicTensorTest_Success00: ";
121 msg += TensorsInfoTest.BasicTensorTest_Success00() ? "OK\n" : "Failed\n";
123 msg += " * BasicTensorTest_Success01: ";
124 msg += TensorsInfoTest.BasicTensorTest_Success01() ? "OK\n" : "Failed\n";
126 msg += " * BasicTensorTest_Success02: ";
127 msg += TensorsInfoTest.BasicTensorTest_Success02() ? "OK\n" : "Failed\n";
129 lblResult.Text = msg;