public void FilePaths()
        {
            BoostTestRunnerCommandLineArgs args = new BoostTestRunnerCommandLineArgs();

            args.LogFile = "log.xml";
            Assert.That(args.LogFile, Is.EqualTo("log.xml"));
            Assert.That(args.ToString(), Is.EqualTo("\"--log_sink=log.xml\""));

            args.WorkingDirectory = @"C:\";
            Assert.That(args.LogFile, Is.EqualTo(@"C:\log.xml"));
            Assert.That(args.ToString(), Is.EqualTo("\"--log_sink=C:\\log.xml\""));

            args.LogFile = @"D:\Temp\log.xml";
            Assert.That(args.LogFile, Is.EqualTo(@"D:\Temp\log.xml"));
            Assert.That(args.ToString(), Is.EqualTo("\"--log_sink=D:\\Temp\\log.xml\""));
        }
        public void CloneCommandLineArgs()
        {
            BoostTestRunnerCommandLineArgs args  = GenerateCommandLineArgs();
            BoostTestRunnerCommandLineArgs clone = args.Clone();

            Assert.That(args.Tests, Is.EqualTo(clone.Tests));
            Assert.That(args.WorkingDirectory, Is.EqualTo(clone.WorkingDirectory));
            Assert.That(args.LogFile, Is.EqualTo(clone.LogFile));
            Assert.That(args.LogFormat, Is.EqualTo(clone.LogFormat));
            Assert.That(args.LogLevel, Is.EqualTo(clone.LogLevel));
            Assert.That(args.ReportFile, Is.EqualTo(clone.ReportFile));
            Assert.That(args.ReportFormat, Is.EqualTo(clone.ReportFormat));
            Assert.That(args.ReportLevel, Is.EqualTo(clone.ReportLevel));
            Assert.That(args.DetectMemoryLeaks, Is.EqualTo(clone.DetectMemoryLeaks));
            Assert.That(args.StandardErrorFile, Is.EqualTo(clone.StandardErrorFile));
            Assert.That(args.StandardOutFile, Is.EqualTo(clone.StandardOutFile));

            Assert.That(args.ShowProgress, Is.EqualTo(clone.ShowProgress));
            Assert.That(args.BuildInfo, Is.EqualTo(clone.BuildInfo));
            Assert.That(args.AutoStartDebug, Is.EqualTo(clone.AutoStartDebug));
            Assert.That(args.CatchSystemErrors, Is.EqualTo(clone.CatchSystemErrors));
            Assert.That(args.BreakExecPath, Is.EqualTo(clone.BreakExecPath));
            Assert.That(args.ColorOutput, Is.EqualTo(clone.ColorOutput));
            Assert.That(args.ResultCode, Is.EqualTo(clone.ResultCode));
            Assert.That(args.Random, Is.EqualTo(clone.Random));
            Assert.That(args.UseAltStack, Is.EqualTo(clone.UseAltStack));
            Assert.That(args.DetectFPExceptions, Is.EqualTo(clone.DetectFPExceptions));
            Assert.That(args.SavePattern, Is.EqualTo(clone.SavePattern));
            Assert.That(args.ListContent, Is.EqualTo(clone.ListContent));

            Assert.That(args.ToString(), Is.EqualTo(clone.ToString()));
        }
        public void ListContentCommandLineArgs()
        {
            BoostTestRunnerCommandLineArgs args = new BoostTestRunnerCommandLineArgs();

            args.ListContent = ListContentFormat.DOT;

            args.StandardOutFile   = @"C:\Temp\list_content.dot.out";
            args.StandardErrorFile = @"C:\Temp\list_content.dot.err";

            const string expected = "\"--list_content=DOT\" > \"C:\\Temp\\list_content.dot.out\" 2> \"C:\\Temp\\list_content.dot.err\"";

            Assert.That(args.ToString(), Is.EqualTo(expected));

            args.ReportFormat = OutputFormat.XML;
            args.ReportFile   = @"C:\Temp\list_content.report.xml";

            // list content only includes the --list_content and the output redirection commands
            Assert.That(args.ToString(), Is.EqualTo(expected));
        }
        public void StdOutStdErrSink()
        {
            BoostTestRunnerCommandLineArgs args = new BoostTestRunnerCommandLineArgs()
            {
                Log    = Sink.StandardError,
                Report = Sink.StandardOutput
            };

            Assert.That(args.ToString(), Is.EqualTo("\"--log_sink=stderr\" \"--report_sink=stdout\""));
        }
        public void SampleCommandLineArgs()
        {
            BoostTestRunnerCommandLineArgs args = GenerateCommandLineArgs();

            // serge: boost 1.60 requires uppercase input
            Assert.That(args.ToString(), Is.EqualTo("\"--run_test=test,suite/*\" \"--catch_system_errors=no\" \"--log_format=XML\" \"--log_level=test_suite\" \"--log_sink="
                                                    + GenerateFullyQualifiedPath("log.xml") + "\" \"--report_format=XML\" \"--report_level=detailed\" \"--report_sink="
                                                    + GenerateFullyQualifiedPath("report.xml") + "\" \"--detect_memory_leak=0\" \"--detect_fp_exceptions=yes\" > \""
                                                    + GenerateFullyQualifiedPath("stdout.log") + "\" 2> \""
                                                    + GenerateFullyQualifiedPath("stderr.log") + "\""));
        }
        public void VersionCommandLineArgs()
        {
            BoostTestRunnerCommandLineArgs args = new BoostTestRunnerCommandLineArgs()
            {
                Version = true
            };

            // Version without output redirection
            {
                const string expected = "\"--version\"";
                Assert.That(args.ToString(), Is.EqualTo(expected));
            }

            // Version with output redirection
            {
                args.StandardOutFile   = @"C:\Temp\version.out";
                args.StandardErrorFile = @"C:\Temp\version.err";

                const string expected = "\"--version\" > \"C:\\Temp\\version.out\" 2> \"C:\\Temp\\version.err\"";
                Assert.That(args.ToString(), Is.EqualTo(expected));
            }
        }
        public void DefaultCommandLineArgs()
        {
            BoostTestRunnerCommandLineArgs args = new BoostTestRunnerCommandLineArgs();

            Assert.That(args.ToString(), Is.Empty);
        }