TESTS: Refactor building dylib tests