aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2021-04-19 19:08:28 +0200
committerMiguel Costa <miguel.costa@qt.io>2021-04-20 09:25:27 +0000
commit4b3ccef1f0952cfe43a83f0fa642cc2c089192aa (patch)
tree38751167e04a87df617345c248aba7d902922d29 /src
parent905d18c69cb6c57c2b559f6db8bded2406ea1d7b (diff)
Add test client header to QtVsTest package
The auto-test/C# macro client interface header file, MacroClient.h, is now included in the QtVsTest extension package. The header file is now copied to %LOCALAPPDATA% when starting VS after installing QtVsTest. This change will allow development of auto-tests for VS without requiring that the QtVSTools repository be cloned. The only requirement will be the installation of the QtVsTest extension. Change-Id: Ibbcb52c9068e793ea68f4c40b61903891c4c0a9c Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/QtVsTools.sln3
-rw-r--r--src/qtvstest/QtVsTest.cs13
-rw-r--r--src/qtvstest/QtVsTest.csproj4
-rw-r--r--src/tests/CoreFeatures/CoreFeatures.vcxproj2
4 files changed, 18 insertions, 4 deletions
diff --git a/src/QtVsTools.sln b/src/QtVsTools.sln
index 09b63428..d9a69c3d 100644
--- a/src/QtVsTools.sln
+++ b/src/QtVsTools.sln
@@ -91,9 +91,6 @@ EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "QtVsTest", "QtVsTest\QtVsTest.csproj", "{48A50432-6BDF-4DE2-A3AD-3A237D31E49D}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Framework", "Framework", "{06C8A2E6-A894-4DBA-9DFD-B8E5CB8A2B4F}"
- ProjectSection(SolutionItems) = preProject
- qtvstest\MacroClient.h = qtvstest\MacroClient.h
- EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CoreFeatures", "tests\CoreFeatures\CoreFeatures.vcxproj", "{12857847-9877-466C-B056-DD286A219093}"
EndProject
diff --git a/src/qtvstest/QtVsTest.cs b/src/qtvstest/QtVsTest.cs
index ee192a8a..e96ae2bf 100644
--- a/src/qtvstest/QtVsTest.cs
+++ b/src/qtvstest/QtVsTest.cs
@@ -64,11 +64,22 @@ namespace QtVsTest
CancellationToken cancellationToken,
IProgress<ServiceProgressData> progress)
{
- // Install .csmacro syntax highlighting
+ // Get package install path
var uri = new Uri(System.Reflection.Assembly
.GetExecutingAssembly().EscapedCodeBase);
var pkgInstallPath = Path.GetDirectoryName(
Uri.UnescapeDataString(uri.AbsolutePath)) + @"\";
+
+ // Install client interface
+ var qtVsTestFiles = Environment.
+ ExpandEnvironmentVariables(@"%LOCALAPPDATA%\qtvstest");
+ Directory.CreateDirectory(qtVsTestFiles);
+ File.Copy(
+ Path.Combine(pkgInstallPath, "MacroClient.h"),
+ Path.Combine(qtVsTestFiles, "MacroClient.h"),
+ overwrite: true);
+
+ // Install .csmacro syntax highlighting
var grammarFilesPath = Environment.
ExpandEnvironmentVariables(@"%USERPROFILE%\.vs\Extensions\qtcsmacro");
Directory.CreateDirectory(grammarFilesPath);
diff --git a/src/qtvstest/QtVsTest.csproj b/src/qtvstest/QtVsTest.csproj
index 20e03af0..b37c5e1e 100644
--- a/src/qtvstest/QtVsTest.csproj
+++ b/src/qtvstest/QtVsTest.csproj
@@ -86,6 +86,10 @@
<None Include="config\$(VisualStudioVersion)\source.extension.vsixmanifest">
<SubType>Designer</SubType>
</None>
+ <Content Include="MacroClient.h">
+ <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
+ <IncludeInVSIX>true</IncludeInVSIX>
+ </Content>
<Content Include="Resources\QtVsTest.ico" />
<T4Template Include="csmacro.tmLanguage_TT">
<Generator>TextTemplatingFileGenerator</Generator>
diff --git a/src/tests/CoreFeatures/CoreFeatures.vcxproj b/src/tests/CoreFeatures/CoreFeatures.vcxproj
index e79e95d9..2e24409f 100644
--- a/src/tests/CoreFeatures/CoreFeatures.vcxproj
+++ b/src/tests/CoreFeatures/CoreFeatures.vcxproj
@@ -71,8 +71,10 @@
<Import Project="$(QtMsBuild)\qt_defaults.props" />
</ImportGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
+ <IncludePath>$(LOCALAPPDATA)\qtvstest;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
+ <IncludePath>$(LOCALAPPDATA)\qtvstest;$(IncludePath)</IncludePath>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtInstall>$(DefaultQtVersion)</QtInstall>