I have licensed my software under LGPL. I am too lazy to include the licensing headers in all files, so I skipped the unit tests files. Is that a problem?
Do you really care if someone "steals" your unit tests?
I am not a lawyer but ... AFAIK, There is no legal requirement to include the license in every source file, it's just that people like covering their butts. Including your license in a clear README.txt or LICENSE.txt and in the place where you publish your source should be good enough. If this is making you lose sleep just write a script that populates the license comment.
Update based on the comment:
If you really need to get this question answered in a definate manner I suggest you contact software freedom .org
Laziness and skipping steps is always bad. Do the right thing. Do it efficiently. Do it always. End of story.
You might consider using a generic, boilerplate source file for your projects that include your name and a copyright notice. Copy it instead of creating a new file. Also be sure to check the dates and information before you check in to source control each file. This is an easy step.
Adding copyright headers to every source file in your project is a very brief project for someone who knows a scripting language. If you don't know a scripting language like Perl, Python or Ruby, this is a good time to start learning one.
For example, here's a Perl script that adds a copyright header to itself:
#!/usr/bin/perl -w
use strict;
# Copyright Header Here
my $copyright_header = <<COPYRIGHT;
# MyProject v1.0
# Copyright Jader Dias, 2009
COPYRIGHT
open FILE, "<parse.pl" or die $!;
while ( my $line = <FILE> ) {
if ( $line =~ /\#\s*Copyright Header Here/ ) {
print $copyright_header;
} else {
print $line;
}
}
close FILE or die $!;
Depending on the structure of your program, you can either replace a tag in the original file with a copyright header, or just add the header to the very top of the file.
To directly answer the question (whether it's a problem to skimp on license headers in unit test files out of laziness), my gut answer is probably not. Open-source purists and legal experts would probably say that you need to include the license in every source file. I think that's good practice, but failing to do so is not the end of the world, especially if your code comes with a LICENSE.txt file. Even more so for unit test code, which is probably not at all applicable outside the context of your project.
I'm obviously not a lawyer, but if someone were to use your source code in a way not conducive with your license, (LGPL in this case) I have trouble imagining that arguing that the license wasn't included in a particular source file would hold too much water. I would expect someone that wants to use the code to find out what the license is beforehand, and if someone were to steal your code and call it their own, it's not okay just because there wasn't a license header in the file. In my opinion, theft is theft, whether or not there's a sign that says "You're not allowed to steal this." :-) Unfortunately, that's unlikely to be sufficient in the complex world in which we live... (sigh)
Perhaps the best answer is "better safe than sorry", but go with your instinct and the guidance of experienced developers you trust. I guess that's why you asked on SO. ;-)