Import bsd.prog.mk as the basis for bas.tests.mk
Rip out various bits not needed for testing purposes.

Indent to show the structure more clearly.
Add Atffile for lib
Update to add keys argument to pkg_parse_manifest() which implies
adding calls topkg_manifest_keys_{new,free}().
Need an empty Makefile even though there's no C code to test in the
frontend directory.  Yet.
bsd.tests.mk -- allow compiling multiple tests per directory.

Now you can have a series of compiled test programs in one directory
with a Makefile as simple as:

-----------------------------------------
TESTS= test1 test2 test3

.include "../bsd.tests.mk"
-----------------------------------------

This will compile test1.c to test1, test2.c to test2 etc. etc.
See comments in bsd.tests.mk for more details.

Hook tests/lib back up to the Atffile tests.
Fix the path to the libpkg dir -- if it's not right, we won't test
against what was just compiled, but what was last installed.
Fix misprint in error message.

Populate rdeps function should complain about reverse deps not about
normal ones.
Fix analyse_elf() leaking file descriptors

This would cause pkg-check -Ba to hold a file open
for every non-elf file in the system due to not
calling elf_end()