unittests: fix modulewise unittests/fix OUTPUT macro

The setup before worked if you just targeted ``all``, but

```bash
make clear tests-core
```

or even e.g.

```base
make OUTPUT=XML clear all
```

are not working.