matkoch / TestFx

Next Level Testing.
Apache License 2.0
34 stars 4 forks source link

Command line arguments to include/exclude suites and tags #6

Open Uli-Armbruster opened 8 years ago

Uli-Armbruster commented 8 years ago

Hi, I think your program is really what we need, but to make use of it we require the same options that MSpec provides:

--exclude --include

I don't know if you want to support this since I don't know if every supported Testing Framework has these options. If you don't, I could provide an adapted version with support of this only for MSpec. I've already forked the current version but I didn't find the necessary entry points in the hurry.

Could you tell me if you would support this or otherwise if you would help me to develop a dedicated fork for this.

matkoch commented 8 years ago

What specific excludes/includes do you need? Assembly level? Type level? What about tags/categories and wildcards?

Uli-Armbruster commented 8 years ago

Tags, for example: [Tags("RegressionTest")] // this attribute supports any number of tags via a params string[] argument! [Subject(typeof(SecurityService), "Authentication")] public class When_authenticating_a_user { ... }

Usage: Usage: mspec.exe [options] Options: -f, --filters Filter file specifying contexts to execute (full type name, one per line). Takes precedence over tags -i, --include Executes all specifications in contexts with these comma delimited tags. Ex. -i "foo,bar,foo_bar" -x, --exclude Exclude specifications in contexts with these comma delimited tags. Ex. -x "foo,bar,foo_bar"

matkoch commented 8 years ago

I actually implemented that once, but removed it for some reason that I don't know anymore )

Here is the draft:

private class Options
{
  [OptionList("assemblies", HelpText = "List of assemblies separated by semicolons.", Required = true, Separator = ';')]
  public IList<string> Assemblies { get; set; }

  [OptionList("filters", HelpText = "List of type/tag filters prefixed as include (+) or exclude (!) separated by semicolons. Wildcards supported. DAT files are interpreted as filter list.", Separator = ';')]
  public IList<string> Filters { get; set; }

  [Option("pause", HelpText = "Enables pausing before the process is terminated.")]
  public bool Pause { get; set; }

  [Option("debug", HelpText = "Enables debugging by calling Debugger.Launch().")]
  public bool Debug { get; set; }

  [Option("htmlReport", HelpText = "Enables generation of a HTML report. Specify 'default' or a custom ZIP archive with a 'template.cshtml' razor template.")]
  public string HtmlReport { get; set; }

  [Option("teamCity", HelpText = "Enables output for JetBrains TeamCity server (auto-detected). Disables standard output.")]
  public bool TeamCity { get; set; }

  [Option("dotCover", HelpText = "Enables code coverage by specifying path to JetBrains DotCover executable.")]
  public string DotCover { get; set; }

  [Option("output", HelpText = "Specifies the output directory for the HTML Report and DotCover as well.")]
  public string Output { get; set; }
}

Please let me know what you think about that.

Uli-Armbruster commented 8 years ago

Looks good for me! Is cleaner than the options of the MSpec runner.

Uli-Armbruster commented 8 years ago

Can't find the draft for this, only for #7

matkoch commented 8 years ago

That was an issue-only draft :grin: I can implement this until next week probably.