Experimental and simulation results of an electron gun test facility, based on pulsed diode acceleration followed by a two-cell rf cavity at 1.5 GHz, are presented here. The main features of this diode-rf combination are: a high peak gradient in the diode (up to 100MV/m) obtained without breakdown conditioning, a cathode shape providing an electrostatic focusing, and an in-vacuum pulsed solenoid to focus the electron beam between the diode and the rf cavity. Although the test stand was initially developed for testing field emitter arrays cathodes, it became also interesting to explore the limits of this electron gun with metallic photocathodes illuminated by laser pulses. The ultimate goal of this test facility is to fulfill the requirements of the SwissFEL project of Paul Scherrer Institute; a projected normalized emittance below 0.4μm for a charge of 200 pC and a bunch length of less than 10 ps (rms). A normalized projected emittance of 0.23μm with 13 pC has been measured at 5 MeV using a Gaussian laser longitudinal intensity distribution on the photocathode. Good agreements with simulations have been obtained for different electron bunch charge and diode geometries. Emittance measurements at a bunch charge below 1 pC were performed for different laser spot sizes in agreement with intrinsic emittance theory [e.g. 0.54μm/mm of laser spot size (rms) for Cu at 274 nm]. Finally, a projected emittance of 1.25+/-0.2μm was measured with 200 pC and 100MV/m diode gradient. © 2010 The American Physical Society.