Exemplo n.º 1
0
        public static LitTestCase Read(string filePath, LitTestConfiguration config)
        {
            ILitCommand[] commands = File.ReadAllLines(filePath)
                                     .Select(line => ILitCommand.Parse(line, config))
                                     .Where(c => c != null)
                                     .Select(e => e !)
                                     .ToArray();
            if (commands.Length == 0)
            {
                throw new ArgumentException($"No lit commands found in test file: {filePath}");
            }
            var xfail = commands.Any(c => c is XFailCommand);

            foreach (var unsupported in commands.OfType <UnsupportedCommand>())
            {
                foreach (var feature in config.Features)
                {
                    if (unsupported.Features.Contains(feature))
                    {
                        throw new SkipException($"Test case not supported: {feature}");
                    }
                }
            }
            return(new LitTestCase(filePath, commands, xfail));
        }
Exemplo n.º 2
0
 public static ILitCommand Parse(string line, LitTestConfiguration config)
 {
     return(ParseArguments(ILitCommand.Tokenize(line), config));
 }
Exemplo n.º 3
0
 public OrCommand(ILitCommand lhs, ILitCommand rhs)
 {
     this.lhs = lhs;
     this.rhs = rhs;
 }