do not build main binary for tests

Building the main binary takes a few seconds and isn't necessary for running the unit tests, so I factored it out.