Ejemplo n.º 1
0
		public static CoverHost CreateHost (string covfile, string program, params string[] arguments)
		{
            if (covfile == null)
                throw new ArgumentNullException ("covfile");

			if (program == null)
				throw new ArgumentNullException ("program");

			var args = new List<string> {program};
			args.AddRange (arguments);

            var data = new CodeRecordData();
            data.Open( covfile );

            var logfile = covfile + ".log";
            var log = new StreamWriter( logfile );
            data.SaveMeta("logfile", logfile);
            data.SaveMeta("dbfile", covfile);
            data.SaveMeta("testmachine", Environment.MachineName );

            var rv = new CoverHost ( args.ToArray() ) { 
                DataStore = data,
                LogFile = log,
            };
			return rv;
		}
Ejemplo n.º 2
0
		public static void Main (string[] args)
		{
			Application.Init ();
			MainWindow win = new MainWindow ();

            if ( args.Length > 0 )
            {
                var records = args[0];
                var dh = new CodeRecordData();
                dh.Open( records );
                var crs = dh.Load();
                win.Load( crs );
            }

			win.Show ();
			Application.Run ();
		}
Ejemplo n.º 3
0
        private static void PrepareHost(CoverHost host, string covfile)
        {
            if (covfile == null)
            {
                throw new ArgumentNullException("covfile");
            }

            var data = new CodeRecordData();

            data.Open(covfile);

            var logfile = covfile + ".log";
            var log     = new StreamWriter(logfile);

            data.SaveMeta("logfile", logfile);
            data.SaveMeta("dbfile", covfile);
            data.SaveMeta("testmachine", Environment.MachineName);

            host.DataStore = data;
            host.LogFile   = log;
        }
Ejemplo n.º 4
0
        public static CoverHost CreateHost(string covfile, string program, params string[] arguments)
        {
            if (covfile == null)
            {
                throw new ArgumentNullException("covfile");
            }

            if (program == null)
            {
                throw new ArgumentNullException("program");
            }

            var args = new List <string> {
                program
            };

            args.AddRange(arguments);

            var data = new CodeRecordData();

            data.Open(covfile);

            var logfile = covfile + ".log";
            var log     = new StreamWriter(logfile);

            data.SaveMeta("logfile", logfile);
            data.SaveMeta("dbfile", covfile);
            data.SaveMeta("testmachine", Environment.MachineName);

            var rv = new CoverHost(args.ToArray())
            {
                DataStore = data,
                LogFile   = log,
            };

            return(rv);
        }
Ejemplo n.º 5
0
 public void LoadCoverage( string db ) {
     var data = new CodeRecordData();
     data.Open( db );
     Records = data.Load();
     metadata = data.LoadMeta();
 }
Ejemplo n.º 6
0
 protected void OpenCoverageFile(object sender, EventArgs e)
 {
     var fb = new FileChooserDialog( "Load a coverage file", this, FileChooserAction.Open, "Cancel", ResponseType.Cancel, "Open", ResponseType.Accept );
     //fb.Filter = new FileFilter() { Name = "coverage files" };
     //fb.Filter.AddPattern( "*.xcov" );
     fb.Response += (o, args) => fb.Hide();
     fb.Run();
     var records = fb.Filename;
     if ( !string.IsNullOrEmpty(records) && File.Exists(records) ) 
     {
         var dh = new CodeRecordData();
         dh.Open( records );
         var crs = dh.Load();
         Load( crs );
     }
 }