Prosecutors in Massachusetts can’t use breathalyzer tests in drunken driving cases, with some exceptions, until the state can show that the crime lab that oversees its breath-testing program is likely to receive a certain type of accreditation, a judge has ruled.

The ruling does not cover all drunken driving cases. Exceptions for the exclusion of breath tests at trial under a previous agreement between defense attorneys and prosecutors include motor vehicle homicide by OUI, OUI causing serious bodily injury, and OUI fifth offense or more, according to court documents.