Signed-off-by: Eunki Hong <eunkiki.hong@samsung.com>
14 files changed:
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
"type": "coreclr",
"request": "launch",
"preLaunchTask": "build",
- "program": "${workspaceFolder}/bin/Debug/netcoreapp3.1/Tizen.NUI.Devel.Tests.dll",
+ "program": "${workspaceFolder}/bin/Debug/net6.0/Tizen.NUI.Devel.Tests.dll",
"args": [],
"env": {
"DESKTOP_PREFIX":"${env:HOME}/dali-env/opt",
"args": [],
"env": {
"DESKTOP_PREFIX":"${env:HOME}/dali-env/opt",
private ManualResetEvent methodExecutionResetEvent;
private TAsyncThreadMgr asyncThreadMgr;
private ManualResetEvent methodExecutionResetEvent;
private TAsyncThreadMgr asyncThreadMgr;
+ private bool testFinished = false;
+
protected override void OnCreate()
{
base.OnCreate();
protected override void OnCreate()
{
base.OnCreate();
{
methodExecutionResetEvent.WaitOne();
{
methodExecutionResetEvent.WaitOne();
- if (asyncThreadMgr.RunTestMethod() == false)
+ if (eventThreadCallback == null || asyncThreadMgr.RunTestMethod() == false)
{
mainTitle.Text = title + "Finished!\nWill be terminated after 5 seconds";
{
mainTitle.Text = title + "Finished!\nWill be terminated after 5 seconds";
timer = new Timer(300);
timer.Tick += OnTick;
timer.Start();
return;
}
timer = new Timer(300);
timer.Tick += OnTick;
timer.Start();
return;
}
- eventThreadCallback.Trigger();
+
+ eventThreadCallback?.Trigger();
}
private bool OnTick(object obj, EventArgs e)
}
private bool OnTick(object obj, EventArgs e)
protected override void OnResume()
{
protected override void OnResume()
{
tlog.Debug(tag, $"OnResume()");
tlog.Debug(tag, $"OnResume()");
}
protected override void OnPause()
}
protected override void OnPause()
protected override void OnTerminate()
{
protected override void OnTerminate()
{
- timer.Dispose();
- mainTitle.Unparent();
- root.Unparent();
+ tlog.Debug(tag, "OnTerminate()");
+
+ // Clear program
+ timer?.Dispose();
+ mainTitle?.Unparent();
+ root?.Dispose();
+ eventThreadCallback?.Dispose();
+
+ // Stop test forcely.
+ if (!testFinished)
+ {
+ // TODO : Currently, it is not works well...
+ // trunner._textRunner.StopTest(true);
+ }
+
base.OnTerminate();
Exit();
}
base.OnTerminate();
Exit();
}
public class PropertyValueTest
{
private const string tag = "NUITEST";
public class PropertyValueTest
{
private const string tag = "NUITEST";
[SetUp]
public void Init()
[SetUp]
public void Init()
/// </remarks>
public void RunAsync(ITestListener listener, ITestFilter filter)
{
/// </remarks>
public void RunAsync(ITestListener listener, ITestFilter filter)
{
- log.Info("Running tests");
+ TLogger.Write("RunAsync Start!\n");
if (LoadedTest == null)
throw new InvalidOperationException("The Run method was called but no test has been loaded");
if (LoadedTest == null)
throw new InvalidOperationException("The Run method was called but no test has been loaded");
StartRun(listener);
WaitForCompletion(Timeout.Infinite);
StartRun(listener);
WaitForCompletion(Timeout.Infinite);
+ TLogger.Write("RunAsync Finished!\n");
/// <returns>True if the run completed, otherwise false</returns>
public bool WaitForCompletion(int timeout)
{
/// <returns>True if the run completed, otherwise false</returns>
public bool WaitForCompletion(int timeout)
{
+ TLogger.Write("WaitForCompletion...\n");
#if !SILVERLIGHT && !PORTABLE
return _runComplete.WaitOne(timeout, false);
#else
#if !SILVERLIGHT && !PORTABLE
return _runComplete.WaitOne(timeout, false);
#else
/// </summary>
private void OnRunCompleted(object sender, EventArgs e)
{
/// </summary>
private void OnRunCompleted(object sender, EventArgs e)
{
+ TLogger.Write("OnRunCompleted\n");
#if PARALLEL
if (_pump != null)
_pump.Dispose();
#if PARALLEL
if (_pump != null)
_pump.Dispose();
+ NUnit.Framework.TUnit.TLogger.Write($"CompositeWorkItem Cancel {force}\n");
if (_children == null)
return;
if (_children == null)
return;
}
private string GetCaseID(string TCID)
}
private string GetCaseID(string TCID)
/// </summary>
public void CancelRun(bool force)
{
/// </summary>
public void CancelRun(bool force)
{
+ NUnit.Framework.TUnit.TLogger.Write($"CancelRun {force}\n");
foreach (var shift in Shifts)
shift.Cancel(force);
}
foreach (var shift in Shifts)
shift.Cancel(force);
}
+ public override void Cancel(bool force)
+ {
+ TLogger.Write($"Cancel SimpleWorkItem force:{force}\n");
+ base.Cancel(force);
+ }
/// <param name="force">true if the run should be aborted, false if it should allow its currently running test to complete</param>
public void CancelRun(bool force)
{
/// <param name="force">true if the run should be aborted, false if it should allow its currently running test to complete</param>
public void CancelRun(bool force)
{
+ NUnit.Framework.TUnit.TLogger.Write($"CancelRun {force}\n");
#if !PORTABLE
lock (cancelLock)
{
#if !PORTABLE
lock (cancelLock)
{
#if PARALLEL
using System;
using System.Threading;
#if PARALLEL
using System;
using System.Threading;
+using NUnit.Framework.TUnit;
namespace NUnit.Framework.Internal.Execution
{
namespace NUnit.Framework.Internal.Execution
{
private void TestWorkerThreadProc()
{
log.Info("{0} starting ", _workerThread.Name);
private void TestWorkerThreadProc()
{
log.Info("{0} starting ", _workerThread.Name);
+ TLogger.Write($"{_workerThread.Name} Started\n");
log.Info("{0} executing {1}", _workerThread.Name, _currentWorkItem.Test.Name);
log.Info("{0} executing {1}", _workerThread.Name, _currentWorkItem.Test.Name);
+ TLogger.Write($"{_workerThread.Name} busy\n");
+
if (Busy != null)
Busy(this, EventArgs.Empty);
if (Busy != null)
Busy(this, EventArgs.Empty);
+
+ TLogger.Write($"{_workerThread.Name} executing {_currentWorkItem.Test.Name}\n");
_currentWorkItem.WorkerId = Name;
_currentWorkItem.Execute();
_currentWorkItem.WorkerId = Name;
_currentWorkItem.Execute();
+ TLogger.Write($"{_workerThread.Name} executing {_currentWorkItem.Test.Name} done\n");
if (Idle != null)
Idle(this, EventArgs.Empty);
if (Idle != null)
Idle(this, EventArgs.Empty);
+ TLogger.Write($"{_workerThread.Name} idle\n");
{
log.Info("{0} stopping - {1} WorkItems processed.", _workerThread.Name, _workItemCount);
}
{
log.Info("{0} stopping - {1} WorkItems processed.", _workerThread.Name, _workItemCount);
}
+ TLogger.Write($"{_workerThread.Name} Finished\n");
/// <param name="force">true if the thread should be aborted, false if it should allow the currently running test to complete</param>
public void Cancel(bool force)
{
/// <param name="force">true if the thread should be aborted, false if it should allow the currently running test to complete</param>
public void Cancel(bool force)
{
+ TLogger.Write($"Cancel TestWorker force:{force}\n");
if (force)
_running = false;
if (force)
_running = false;
{
_currentWorkItem.Cancel(force);
if (force)
{
_currentWorkItem.Cancel(force);
if (force)
/// <param name="force">true if the WorkItem should be aborted, false if it should run to completion</param>
public virtual void Cancel(bool force)
{
/// <param name="force">true if the WorkItem should be aborted, false if it should run to completion</param>
public virtual void Cancel(bool force)
{
+ NUnit.Framework.TUnit.TLogger.Write($"Cancel WorkItem force:{force}\n");
if (Context != null)
Context.ExecutionStatus = force ? TestExecutionStatus.AbortRequested : TestExecutionStatus.StopRequested;
if (Context != null)
Context.ExecutionStatus = force ? TestExecutionStatus.AbortRequested : TestExecutionStatus.StopRequested;
/// <param name="force">true if the WorkShift should be aborted, false if it should allow its currently running tests to complete</param>
public void Cancel(bool force)
{
/// <param name="force">true if the WorkShift should be aborted, false if it should allow its currently running tests to complete</param>
public void Cancel(bool force)
{
+ NUnit.Framework.TUnit.TLogger.Write($"Cancel shift {force}\n");
if (force)
this.IsActive = false;
if (force)
this.IsActive = false;
public void SetData(TestCommand testCommand, TestMethod testMethod, object[] arguments, TestExecutionContext context, bool IsAsyncOperation)
{
public void SetData(TestCommand testCommand, TestMethod testMethod, object[] arguments, TestExecutionContext context, bool IsAsyncOperation)
{
+ TLogger.Write($"TAsyn.SetData()\n");
this.testCommand = testCommand;
this.testMethod = testMethod;
this.arguments = arguments;
this.testCommand = testCommand;
this.testMethod = testMethod;
this.arguments = arguments;
runTearDown();
Thread.Sleep(50);
#endregion
runTearDown();
Thread.Sleep(50);
#endregion
testCommand._testMethodRunComplete.Set();
_methodExecutionResetEvent.Reset();
_methodExecutionResetEvent.WaitOne();
testCommand._testMethodRunComplete.Set();
_methodExecutionResetEvent.Reset();
_methodExecutionResetEvent.WaitOne();
#region nguyen.vtan add TearDown
runTearDown();
#endregion
#region nguyen.vtan add TearDown
runTearDown();
#endregion
testCommand._testMethodRunComplete.Set();
_methodExecutionResetEvent.Reset();
_methodExecutionResetEvent.WaitOne();
testCommand._testMethodRunComplete.Set();
_methodExecutionResetEvent.Reset();
_methodExecutionResetEvent.WaitOne();
//TLogger.Write("Executing the application: " + pkgName + "...");
Tizen.Log.Fatal("NUITEST", $"Executing the application: {pkgName}");
//TLogger.Write("Executing the application: " + pkgName + "...");
Tizen.Log.Fatal("NUITEST", $"Executing the application: {pkgName}");
+ Tizen.Log.Fatal("NUITEST", $"dllPath: {dllPath}");
string exeFilePathName = "";
string exeFilePathName = "";
- if (dllPath.Contains("netcoreapp"))
+ if (dllPath.Contains("net6.0"))
{
exeFilePathName = string.Format(dllPath + "Tizen.{0}Tests.dll", pkgName);
}
else
{
{
exeFilePathName = string.Format(dllPath + "Tizen.{0}Tests.dll", pkgName);
}
else
{
- exeFilePathName = string.Format(dllPath + "Debug/netcoreapp3.1/Tizen.{0}dll", pkgName);
+ exeFilePathName = string.Format(dllPath + "Debug/net6.0/Tizen.{0}dll", pkgName);
}
//TLogger.Write("exeFilePathName : " + exeFilePathName);
Tizen.Log.Fatal("NUITEST", $"exeFilePathName : {exeFilePathName}");
}
//TLogger.Write("exeFilePathName : " + exeFilePathName);
Tizen.Log.Fatal("NUITEST", $"exeFilePathName : {exeFilePathName}");
return Summary.FailureCount + Summary.ErrorCount + Summary.InvalidCount;
}
return Summary.FailureCount + Summary.ErrorCount + Summary.InvalidCount;
}
+ public void StopTest(bool force)
+ {
+ TLogger.Write($"StopTest force:{force}\n");
+ _runner.StopRun(force);
+ }
+
public void ReportResults(ITestResult result)
{
Summary = new ResultSummary(result);
public void ReportResults(ITestResult result)
{
Summary = new ResultSummary(result);