Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
CountrySideEngineer committed Mar 10, 2023
2 parents b19b014 + 65c3775 commit a4aceef
Show file tree
Hide file tree
Showing 12 changed files with 130 additions and 7 deletions.
Binary file modified dev/src/bin/Release/netcoreapp3.1/gtest_gui.dll
Binary file not shown.
Binary file modified dev/src/bin/Release/netcoreapp3.1/gtest_gui.exe
Binary file not shown.
Binary file modified dev/src/bin/Release/netframework/gtest_gui.exe
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using gtest_gui.Model;
using gtest2html;
using System;
using System.Collections.Generic;
using System.Text;

namespace gtest_gui.Command.Argument
{
public class SingleSelectedTestCommandArgument : TestCommandArgument
{
/// <summary>
/// Default constructor.
/// </summary>
public SingleSelectedTestCommandArgument() : base() { }

/// <summary>
/// Constructor with TestInformation object.
/// </summary>
/// <param name="testInfo">Test information.</param>
public SingleSelectedTestCommandArgument(TestInformation testInfo) : base(testInfo) { }

/// <summary>
/// Constructor with TestCase data.
/// </summary>
/// <param name="testCase"></param>
public SingleSelectedTestCommandArgument(TestCase testCase) : base(testCase) { }

/// <summary>
/// Test item id value.
/// </summary>
public int TestItemId { get; set; }
}
}
26 changes: 26 additions & 0 deletions dev/src/gtest_gui/gtest_gui/Command/SingleTestExecuteCommand.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
using gtest_gui.Command.Argument;
using gtest_gui.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace gtest_gui.Command
{
public class SingleTestExecuteCommand : TestExecuteCommand
{
public override object ExecuteCommand(TestCommandArgument cmdArgument)
{
SingleSelectedTestCommandArgument arg = (SingleSelectedTestCommandArgument)cmdArgument;
TestInformation testInfo = new TestInformation(arg.TestInfo);
foreach (var item in testInfo.TestItems)
{
item.IsSelected = false;
}
testInfo.TestItems.ElementAt(arg.TestItemId).IsSelected = true;
TestCommandArgument cmdArg = new TestCommandArgument(testInfo);

return base.ExecuteCommand(cmdArg);
}
}
}
7 changes: 6 additions & 1 deletion dev/src/gtest_gui/gtest_gui/MainWindow.xaml
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,11 @@
SelectedIndex="{Binding SelectedTestIndex}"
IsEnabled="{Binding CanReloadTest}"
IsReadOnly="True"
IsSynchronizedWithCurrentItem="True"
>
<DataGrid.InputBindings>
<MouseBinding Command="{Binding RunSingleTestCommand}" MouseAction="LeftDoubleClick"/>
</DataGrid.InputBindings>
<DataGrid.Columns>
<DataGridTemplateColumn CanUserResize="False">
<DataGridTemplateColumn.Header>
Expand Down Expand Up @@ -102,7 +106,8 @@
IsReadOnly="True"
ElementStyle="{StaticResource DataGridColumnCenterTextStyle}"
CellStyle="{StaticResource DataGridCellOkNgStyle}"
/>
>
</DataGridTextColumn>
<DataGridTemplateColumn IsReadOnly="False"
Header="履歴"
CanUserResize="False"
Expand Down
16 changes: 16 additions & 0 deletions dev/src/gtest_gui/gtest_gui/Model/TestInformation.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,22 @@ public TestInformation()
TestItems = testItems;
}

/// <summary>
/// Copy constructor.
/// </summary>
/// <param name="src">Copy source object.</param>
public TestInformation(TestInformation src)
{
TestFile = src.TestFile;
var testItems = new List<TestItem>();
foreach (var srcItem in src.TestItems)
{
TestItem newItem = new TestItem(srcItem);
testItems.Add(newItem);
}
TestItems = testItems;
}

/// <summary>
/// Compare with other TestInformation object.
/// </summary>
Expand Down
10 changes: 10 additions & 0 deletions dev/src/gtest_gui/gtest_gui/Model/TestItem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ public TestItem()
Result = string.Empty;
}

/// <summary>
/// Copy constructor.
/// </summary>
/// <param name="src">Copy source object.</param>
public TestItem(TestItem src)
{
Name = src.Name;
IsSelected = src.IsSelected;
}

/// <summary>
/// Determine whether the test datas are equal.
/// </summary>
Expand Down
29 changes: 28 additions & 1 deletion dev/src/gtest_gui/gtest_gui/ViewModel/GTestGuiViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ public class GTestGuiViewModel : ViewModelBase
/// </summary>
protected DelegateCommand _loadTestCommand;

protected DelegateCommand _runSingleTestCommand;

/// <summary>
/// Delegate to notify the test finished.
/// </summary>
Expand Down Expand Up @@ -252,6 +254,18 @@ public DelegateCommand ShowHistoryCommand
}
}

public DelegateCommand RunSingleTestCommand
{
get
{
if (null == _runSingleTestCommand)
{
_runSingleTestCommand = new DelegateCommand(RunSingleTestCommandExecute);
}
return _runSingleTestCommand;
}
}

/// <summary>
/// Actual command function to select target test file.
/// </summary>
Expand Down Expand Up @@ -313,7 +327,6 @@ protected void UpdateCanCommandExecute()
/// </summary>
public void RunTestCommandExecute()
{
//var command = new TestExecuteCommand();
var command = new TestExecuteAsyncCommand();
var argument = new TestCommandArgument(TestInfo);
_ = ExecuteCommand(command, argument);
Expand Down Expand Up @@ -384,6 +397,20 @@ public void ShowHistoryCommandExecute()
mover.Move(this);
}

/// <summary>
/// Run selected one test.
/// </summary>
public void RunSingleTestCommandExecute()
{
var command = new SingleTestExecuteCommand();
var commandArg = new SingleSelectedTestCommandArgument(TestInfo)
{
TestItemId = SelectedTestIndex
};
ExecuteCommand(command, commandArg);
LoadTestCommandExecute();
}

protected bool _isCheckAll = false;
public bool IsCheckAll
{
Expand Down
6 changes: 3 additions & 3 deletions dev/src/gtest_gui/gtest_gui/gtest_gui.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@
<OutputType>WinExe</OutputType>
<TargetFramework>netcoreapp3.1</TargetFramework>
<UseWPF>true</UseWPF>
<AssemblyVersion>0.6.0.0</AssemblyVersion>
<FileVersion>0.6.0.0</FileVersion>
<Version>0.2.3.0</Version>
<AssemblyVersion>0.7.0.0</AssemblyVersion>
<FileVersion>0.7.0.0</FileVersion>
<Version>0.7.0.0</Version>
<Authors>CountrySideEngineer</Authors>
<PackageLicenseExpression />
<NeutralLanguage>ja-JP</NeutralLanguage>
Expand Down
4 changes: 2 additions & 2 deletions dev/src/gtest_gui/gtest_gui_dotNet/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,5 @@
// すべての値を指定するか、次を使用してビルド番号とリビジョン番号を既定に設定できます
// 既定値にすることができます:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("0.6.0.0")]
[assembly: AssemblyFileVersion("0.6.0.0")]
[assembly: AssemblyVersion("0.7.0.0")]
[assembly: AssemblyFileVersion("0.7.0.0")]
6 changes: 6 additions & 0 deletions dev/src/gtest_gui/gtest_gui_dotNet/gtest_gui_dotNet.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,9 @@
<Compile Include="..\gtest_gui\Command\Argument\ProgressChangedCommandArgument.cs">
<Link>Command\Argument\ProgressChangedCommandArgument.cs</Link>
</Compile>
<Compile Include="..\gtest_gui\Command\Argument\SingleSelectedTestCommandArgument.cs">
<Link>Command\Argument\SingleSelectedTestCommandArgument.cs</Link>
</Compile>
<Compile Include="..\gtest_gui\Command\Argument\TestCommandArgument.cs">
<Link>Command\Argument\TestCommandArgument.cs</Link>
</Compile>
Expand All @@ -88,6 +91,9 @@
<Compile Include="..\gtest_gui\Command\LoadTestLogCommand.cs">
<Link>Command\LoadTestLogCommand.cs</Link>
</Compile>
<Compile Include="..\gtest_gui\Command\SingleTestExecuteCommand.cs">
<Link>Command\SingleTestExecuteCommand.cs</Link>
</Compile>
<Compile Include="..\gtest_gui\Command\TestExecuteAsyncCommand.cs">
<Link>Command\TestExecuteAsyncCommand.cs</Link>
</Compile>
Expand Down

0 comments on commit a4aceef

Please sign in to comment.