The design and testing of integrated circuits for submillimeter-wave spectroscopy