aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Costa <miguel.costa@qt.io>2023-11-28 12:38:11 +0100
committerMiguel Costa <miguel.costa@qt.io>2023-12-04 17:04:04 +0000
commitc87bf6379b866ee3482eb4e04ceb8979bd8ee258 (patch)
treefb35f76b3d432047a0435b433315a2983916c90b
parent15a415b4e42daa35811606bb1fd0dadcc6ec0a3a (diff)
Check temp 'qmake' folder generated in IntDir
Unit-test to check the fix of the issue of changes to IntDir not being taken into account when generating Qt vars. This should be fixed as of e0d214ec36041d3ee9cb40f00c38c29ef259b5e3 Fixes: QTVSADDINBUG-860 Fixes: QTVSADDINBUG-872 Change-Id: I1ca508b77cb889f9789a288b7ccbe099b61f7d68 Reviewed-by: Karsten Heimrich <karsten.heimrich@qt.io>
-rw-r--r--Tests/Test_QtMsBuild.Build/Test_IntDir.cs37
-rw-r--r--Tests/Test_QtMsBuild.Build/Test_QtMsBuild.Build.csproj1
2 files changed, 38 insertions, 0 deletions
diff --git a/Tests/Test_QtMsBuild.Build/Test_IntDir.cs b/Tests/Test_QtMsBuild.Build/Test_IntDir.cs
new file mode 100644
index 00000000..96a0d036
--- /dev/null
+++ b/Tests/Test_QtMsBuild.Build/Test_IntDir.cs
@@ -0,0 +1,37 @@
+/***************************************************************************************************
+ Copyright (C) 2023 The Qt Company Ltd.
+ SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
+***************************************************************************************************/
+
+using System;
+using System.IO;
+using Microsoft.Build.Construction;
+using Microsoft.VisualStudio.TestTools.UnitTesting;
+
+namespace QtVsTools.Test.QtMsBuild.Build
+{
+ [TestClass]
+ public class Test_IntDir
+ {
+ [TestMethod]
+ public void IntDir()
+ {
+ using var temp = new TempProject();
+ temp.Clone($@"{Properties.SolutionDir}Tests\ProjectFormats\304\QtProjectV304.vcxproj");
+ var xml = ProjectRootElement.Open(temp.ProjectPath);
+ var props = xml.AddPropertyGroup();
+ props.AddProperty("OldIntDir", "$(IntDir)");
+ props.AddProperty("IntDir", @"$(ProjectDir)build\$(Configuration)\");
+ xml.Save();
+
+ var project = MsBuild.Evaluate(temp.ProjectPath,
+ ("Platform", "x64"), ("Configuration", "Debug"),
+ ("QtMsBuild", Path.Combine(Environment.CurrentDirectory, "QtMsBuild")));
+ Assert.IsTrue(project.Build("Rebuild"));
+ Assert.IsTrue(
+ File.Exists(project.ExpandString($@"$(IntDir)\qmake\temp\props.txt")));
+ Assert.IsFalse(
+ File.Exists(project.ExpandString($@"$(OldIntDir)\qmake\temp\props.txt")));
+ }
+ }
+}
diff --git a/Tests/Test_QtMsBuild.Build/Test_QtMsBuild.Build.csproj b/Tests/Test_QtMsBuild.Build/Test_QtMsBuild.Build.csproj
index c81bb0f7..75232854 100644
--- a/Tests/Test_QtMsBuild.Build/Test_QtMsBuild.Build.csproj
+++ b/Tests/Test_QtMsBuild.Build/Test_QtMsBuild.Build.csproj
@@ -110,6 +110,7 @@
<Compile Include="Props.cs" />
<Compile Include="Logger.cs" />
<Compile Include="MsBuild.cs" />
+ <Compile Include="Test_IntDir.cs" />
<Compile Include="Test_LateBinding.cs" />
<Compile Include="Test_Eval.cs" />
<Compile Include="Test_Build.cs" />