views:

91

answers:

3

I'm considering two possibilities:

  1. include NUnit with the source code of an open-source project - to make it very easy for the potential contributors to run automated tests right away. I feel it is important to promote the "tests-first" culture in this project (or at least make it clear to everyone that tests matter).
  2. distribute the source code without it, but then I'd have to describe in the readme how to make the tests run and include a link to the NUnit download page.

The question: Is #1 legal? Which of the two options is normally preferred? I'd like to hear from those familiar with the license legalese and those familiar with the common practices.

+2  A: 

As far as the legality goes, I'm not a lawyer and you should talk to one about it.

Include your unit tests in your open source project. You do not have to redistribute the [n/j]Unit runtime libraries when you publish.

Let me rephrase that. DO NOT redistribute the j/nUnit run times with your project. You can keep the unit tests in your project. The only time you would want to redistribute the unit frameworks is if the version was disappearing and you couldn't use a newer version.

monksy
+1 I agree. Another good reason is that even if it's legal to bundle NUnit with your open source project, there's a high likelihood that NUnit will change over time so you will actually be doing your users a disservice by giving them a cruddy older version instead of the latest and greatest. Just bundle in your unit tests and then include a link to where they can download NUnit.
Repo Man
the question is not about "bundling", but about checking it in into a source code repository. This is aimed at developers/contributors rather than users
azheglov
A: 

A lot of projects do this with external libraries so anyone who checks it out immediately has all the binaries in case they need additional libraries. I have seen some projects that include a full binary copy of the tools they require, so you have the exact version the app needs, plus another folder that just has the exact dlls or whatever the project needs.

Wayne M
Do you have examples of such projects? I'd like to take a quick look at their source code. Thanks!
azheglov
A: 

I'll try to answer the question myself.

First of all it's important to separate our open-source product's binary distribution (aimed at users) from its source-code repository (which is for developers/contributors). The question really concerns the latter. I've looked at two open-source products as examples.

NUnit

  • binary: has a dependency on fit (included with license)
  • source: has dependencies on NAnt (download it yourself) and log4net (included without a license)

Moq

  • binary: no dependencies
  • source includes the following external dependencies:
  • Silverlight testing tools - included without a licence
  • Microsoft .NET framework reference assemblies - no license
  • Castle - license included (Castle project uses the Apache license, and based on my reading of it, that's a requirement)

So, inclusion of third-party development/build/testing tools with the source code (not with production binaries) seems to be a common practice, and the tools can be included with or without a license notice depending on the type of license and its requirements. You can include the license just in case.

azheglov