Question: So I need to run a bunch of (maven) tests with testfiles being supplied as an argument to a maven task.

Something like this:

`mvn clean test -Dtest=<filename>`

And the test files are usually organized into different directories. So I'm trying to write a script which would execute the above 'command' and automatically feed the name of all files in a given dir to the `-Dtest`.

So I started out with a shellscript called 'run\_test':

```
#!/bin/sh
if test $# -lt 2; then
    echo "$0: insufficient arguments on the command line." >&1
    echo "usage: $0 run_test dirctory" >&1
    exit 1
fi
for file in allFiles <<<<<<< what should I put here? Can I somehow iterate thru the list of all files' name in the given directory put the file name here?
     do mvn clean test -Dtest= $file  

exit $?

```

The part where I got stuck is how to get a list of filenames. 
Thanks,

Answer: 
I haven't figured out whether it is a bug or intentional (for some reason) in matplotlib, but in order to get a full legend label you need to leave a trailing comma on your list of labels:

```
figlegend((k),('Limit',),loc='lower center')

```

change that line and your code:

```
from pylab import *
k = plot((0, 1),(1, 1))
figlegend((k),('Limit',),loc='lower center')
savefig('test.pdf')

```

produces the figure:

![full legend label](https://i.stack.imgur.com/tLxuw.png)

Alternatively, one can use `[]` to achieve the same result:

```
figlegend((k),(['Limit']),loc='lower center')

```
The answer to your problem is the following.

For the names of the legend, you have to surround it in square brackets, like this:

```
figlegend((k),[('Limit')],loc='lower center')

```

as you can see the legend name 'limit' is surrounded in square brackets, and this will then display the full name.

```
Here would be the full code:
from pylab import *
k = plot((0, 1),(1, 1))
figlegend((k),[('Limit')],loc='lower center')
savefig('test.pdf')

```