While function testing the BOP’s from the Toolpusher’s remote panel it was noticed that the shear rams had closed without manually activating the BOP control valve lever. One joint of 5” drill pipe was squashed but not sheared. Fortunately the pipe did not shear and drop the string down hole. The red “closed” light had been noticed by a crewman and the position of the rams investigated prior to picking up the test string. However, recently another string was accidentally damaged and parted causing the rest of the string to be dropped when the string was picked up with the shear rams closed.