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)); }
public static ILitCommand Parse(string line, LitTestConfiguration config) { return(ParseArguments(ILitCommand.Tokenize(line), config)); }
public OrCommand(ILitCommand lhs, ILitCommand rhs) { this.lhs = lhs; this.rhs = rhs; }