NPanday
  1. NPanday
  2. NPANDAY-418

Automatically exclude test sources from main sources in compile-plugin

    Details

      Description

      I'd like to run a configuration, where all test sources are automatically excluded from the main compilation.

      Usually in .NET-Projects, Tests are in a separate assembly. NPanday supports having tests within the same Project, but then they have to be in a separate folder.

      I'd like support for these two layouts:

      Layout one
      MyProj
        - Some.cs
        - More
          - Here.cs 
        Test
          - SomeTest.cs
          - More
            - HereTest.cs
      
      Layout two
      MyProj
        - Some.cs
        - SomeTest.cs
        - More
          - Here.cs
          - HereTest.cs 
      

      In both cases it should be sufficient to tell NPanday how to find test fixtures. Then it can figure out that those are not to be included in the main artifact.

      What do you think?

        Activity

        Hide
        Lars Corneliussen added a comment -

        Currently we use the csc /recurse option. I think we should use Ant-like include/exclude semantics for both normal and test sources.

        Show
        Lars Corneliussen added a comment - Currently we use the csc /recurse option. I think we should use Ant-like include/exclude semantics for both normal and test sources.
        Hide
        Brett Porter added a comment -

        I definitely agree with that, to avoid the verbose <includeSource> and file copying (I think there is an open issue for this already though?)

        Show
        Brett Porter added a comment - I definitely agree with that, to avoid the verbose <includeSource> and file copying (I think there is an open issue for this already though?)
        Hide
        Lars Corneliussen added a comment -

        Mostly done. Currently it wouldn't work, if testDir is inside sourceDir, but only if they are equal. (For example both ./)

        Show
        Lars Corneliussen added a comment - Mostly done. Currently it wouldn't work, if testDir is inside sourceDir, but only if they are equal. (For example both ./)
        Hide
        Brett Porter added a comment -

        What needs to be done to finish this off?

        Show
        Brett Porter added a comment - What needs to be done to finish this off?
        Hide
        Lars Corneliussen added a comment -

        The directory exclusion works fine IIRC.
        Maybe we should "normalize" all included file-paths (basedir-relative) and then explicitly exclude the test files from the main files.

        But it is also OK like it is.
        Not sure if docs are updated.

        Show
        Lars Corneliussen added a comment - The directory exclusion works fine IIRC. Maybe we should "normalize" all included file-paths (basedir-relative) and then explicitly exclude the test files from the main files. But it is also OK like it is. Not sure if docs are updated.

          People

          • Assignee:
            Lars Corneliussen
            Reporter:
            Lars Corneliussen
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development