It is usually the head gasket leaking compression and combustion gas pressure into the cooling system jacket from the head gasket. If you heat up the engine in the driveway by holding 2K rpm until at operating temperature with the pressure cap removed and it seems fine, then you install the pressure cap and it immediately overheats, the head gasket is leaking. There is also a chemical test but the pressure is coming from the engine head gasket in most cases and the cost of repair may be over what the vehicle is worth. My test (same as GEO mentioned) is simple and will tell you quick if you want to spend $2.5K to repair the engine with a rebuilt head and gasket or dump it for scrap.
Even if it was the water pump (not likely), the failure caused it to overheat and warp the head = gasket seal failure. The machine shop dohc head rebuild will be about $800+ plus all the extras like gaskets and labor.
I wouldn't advise using a used head without warranty! You then take the risk that a very pricey bill may X2.
Get a new head or the OK from a macine shop that your head is serviceable and worthy of the $ fix effort.
Anyway you can look at it, the car will not be easily fixed if the head gasket is blown from an overheating.
If you replace the head gasket with the original warped head, it will be a total waste of ($) time and effort.
The pressure cap is usually about 15 PSI, when you introduce an external pressure force = instant boiling.
Hot coolant under pressure, then your engine pumps in hot gas pressure over 200 PSI from combustion.
As the gas leak bubbles accumulate, they overtake the 15 psi pressure cap and it all spews in a boil out.