コード例 #1
0
            public void GetPipeNameForPathOptLength()
            {
                var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar);
                var name = BuildServerConnection.GetPipeNameForPathOpt(path);

                // We only have ~50 total bytes to work with on mac, so the base path must be small
                Assert.Equal(43, name.Length);
            }
コード例 #2
0
            public void GetPipeNameForPathOptSlashes()
            {
                var path = string.Format(@"q:{0}the{0}path", Path.DirectorySeparatorChar);
                var name = BuildServerConnection.GetPipeNameForPathOpt(path);

                Assert.Equal(name, BuildServerConnection.GetPipeNameForPathOpt(path));
                Assert.Equal(name, BuildServerConnection.GetPipeNameForPathOpt(path + Path.DirectorySeparatorChar));
                Assert.Equal(name, BuildServerConnection.GetPipeNameForPathOpt(path + Path.DirectorySeparatorChar + Path.DirectorySeparatorChar));
            }
コード例 #3
0
            public async Task RunServerWithLongTempPath()
            {
                string pipeName = BuildServerConnection.GetPipeNameForPathOpt(Guid.NewGuid().ToString());
                string tempPath = new string('a', 100);

                using (var serverData = await ServerUtil.CreateServer(pipeName, tempPath: tempPath))
                {
                    // Make sure the server is listening for this particular test.
                    await serverData.ListenTask;
                    var exitCode = await RunShutdownAsync(serverData.PipeName, waitForProcess : false).ConfigureAwait(false);

                    Assert.Equal(CommonCompiler.Succeeded, exitCode);
                    await serverData.Verify(connections : 1, completed : 1);
                }
            }
コード例 #4
0
        protected override string GetDefaultPipeName()
        {
            var clientDirectory = AppDomain.CurrentDomain.BaseDirectory;

            return(BuildServerConnection.GetPipeNameForPathOpt(clientDirectory));
        }