What platform are you building on/for?
If you build a full toolchain via the build script then it will also build Foundation (first swift-foundation and its dependencies and then swift-corelibs-foundation on top of it). However, on Apple platforms like macOS, the stdlib/Foundation always come from the OS itself (IIRC building a toolchain and selecting it in Xcode to use when building the swift-foundation package will not use the stdlib from that toolchain, it will use the stdlib from your Xcode SDK, and building a macOS toolchain does not build Foundation). So the easiest way to go about building/testing both of these together might be to build via the build script (which will build and test both) on a platform like Linux or Windows instead of macOS (where the build script does not build Foundation because Foundation comes from the OS rather than the toolchain).