Well it depends on what test as to if it would pass. I'm sure there are still some places that do some sort of actual old school tail pipe testing, but most are just using the OBD2 protocols and checking that. There is no actual "test" of the car's actual emissions. And that is easily done, that's all software.
Diesels didn't get subjected to any of the tailpipe type testing we used to have here. And we had originally the [useless] BAR90, that was an idle test, and just checked for HC and CO. A diesel would happily pass that test with flying colors.... and I proved that point to a coworker by sticking the probe in my 1979 Rabbit. It produced less HC and CO at idle than any gasoline car ever could, it was on the ragged edge of sample dilution it was so low.
Then we got the IM240 test, which was run on a dyno, and simulated light loaded driving. That one checked for HC, CO, and NOx. Lots and lots of cars failed that test that would have otherwise had no trouble with the BAR90. That's when the non-functioning EGR systems on gassers that had often been clogged up for thousands of miles became apparent. But again, no diesels got tested on this equipment.
Then we went to the OBD2 test, and 1997+ diesels below 8500 GVWR got added. Which originally, just meant Volkswagen TDIs and a handful of MB diesel E-classes, as that is all that there were available here at the time.