public override IEnumerable<object[]> GetData(MethodInfo methodUnderTest, Type[] parameterTypes)
        {
            var makefiles = Directory.GetFiles(Directory.GetCurrentDirectory(), "test-*.shade").Select(Path.GetFileName);
            var loader = new DefaultLoader(new DefaultLog(new SakeSettings { Output = Console.Out }));
            foreach (var makefile in makefiles)
            {
                IBuilder builder;
                try
                {
                    builder = loader.Load(new Options { Makefile = makefile });
                }
                catch (Exception)
                {
                    builder = null;
                }

                if (builder == null)
                {
                    yield return new object[] { makefile, null };
                }
                else
                {
                    foreach (var target in builder.Targets.Values.Where(target => target.Name.StartsWith("test-")))
                    {
                        yield return new object[] { makefile, target.Name };
                    }
                }
            }
        }
Beispiel #2
0
 public void MakefileTarget(string makefile, string target)
 {
     var settings = new SakeSettings { Output = new RemoveEscapes(Console.Out) };
     var loader = new DefaultLoader(new DefaultLog(settings), settings);
     var engine = new SakeEngine(settings, loader, new DefaultRunner());
     engine.Execute(new Options { Makefile = makefile, Targets = new[] { target } });
 }
Beispiel #3
0
 public DefaultLoaderTests()
 {
     _settings = new SakeSettings { Output = new StringWriter() };
     _loader = new DefaultLoader(new DefaultLog(_settings));
 }