If secp256k1.c is built without SECP256K1_BUILD the non-null argument tests get compiled out and then the tests crash.
One way to address that would be to simply have test.c and secp256k1.c set the macro before importing the headers. I think this would be pretty fool-proof. If there is some reason that can’t be done secp256k1.c compile could fail if SECP256K1_BUILD isn’t set. I prefer the foolproof way because demanding the build system set some define is more trouble for users that aren’t using the build system.
Related, USE_FIELD_INV_BUILTIN/USE_SCALAR_INV_BUILTIN should get automatically defaulted. (maybe these go away with safegcd?) right now a non-buildsystem user needs to set them.
Perhaps for the rest too… I think now that there aren’t defines needed for the fe/scalar type it should be possible to build with zero defines.