A common device used to do this was the eprouvette. This is a French word and these days it means a "test-tube", but in an earlier era it was used to also denote a device used to test and prove the strength of gunpowder.
The simplest form of this device is a fixed mortar tube, such as the one shown below:
An Eprouvette mortar made of cast iron. Click on image to enlarge.
These were typically made of cast-iron or bronze. The one shown in the image above is only about 5 - 6 inches long, but there were some larger models made as well. The angle of the barrel is fixed at 45 degrees. To test the strength of black powder, a person simply loads the device with a standard amount of powder, then adds a standard weight of shot. Then the person discharges the device and measures the distance that the shot weight flew and compares it with the expected standard distance for the powder.
Of course, with a device such as this, the person conducting the test has to be outside and be able to see where the shot landed, which might be difficult in certain situations. Therefore, people began to invent more portable eprouvette devices.
Three eprouvette devices. Click on images to enlarge.
In devices like the ones above, a standard charge of black powder is loaded into them and then the devices are discharged. The force of discharge compresses a spring, which moves an indicator. In the first two examples, the force of the explosion moves a ratchet gear (the round wheel with teeth) against spring tension. There are markings on the ratchet gear that indicate the strength of the explosion. In the third example, the spring is V shaped and when the tester is discharged, the spring compresses and moves a slider which indicates the force of the explosion.
These devices went out of fashion in the middle of the 19th century as black powder manufacturing quality began to improve. These days, they may only be purchased in auction houses or by manufacturers specializing in period firearms.