Skip to content

Commit 41569ce

Browse files
committed
TO-DROP: allow attaching conveniently to the functional tests
Currently, it is not possible to run the functional tests from within Visual Studio, as the environment is set up wrong, somehow. Instead, the tests have to be run via `script/RunFunctionaltests.bat` (which takes an optional `--test=<full-class-name>` argument). This makes single-stepping somewhat hard. With this commit (which is not intended to be merged into the main branch!), setting the environment variable `DDD` will force the functional test to wait until a debugger is attached to the process. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 8b0218b commit 41569ce

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

GVFS/GVFS.FunctionalTests/Program.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,22 @@
55
using System.Collections.Generic;
66
using System.Diagnostics;
77
using System.IO;
8+
using System.Threading;
89

910
namespace GVFS.FunctionalTests
1011
{
1112
public class Program
1213
{
1314
public static void Main(string[] args)
1415
{
16+
if (Environment.GetEnvironmentVariable("DDD") == "1")
17+
{
18+
Console.WriteLine($"pid: {Process.GetCurrentProcess().Id}");
19+
while (!Debugger.IsAttached)
20+
{
21+
Thread.Sleep(3000);
22+
}
23+
}
1524
Properties.Settings.Default.Initialize();
1625
Console.WriteLine("Settings.Default.CurrentDirectory: {0}", Settings.Default.CurrentDirectory);
1726
Console.WriteLine("Settings.Default.PathToGit: {0}", Settings.Default.PathToGit);

0 commit comments

Comments
 (0)