I have done my Dmax already. One reason I got it was to not worry about smog tests!!! Heck, they are towing vehicles off the road with things like Cats removed!!
Now back to smoging the sami. If you had to test before, you will still have to test, even with a diesel swap.
It must tested be for the year of the motor, which must be newer than the vehicle it is in. Plus you are putting a motor in a vehicle it never came in. So a trip to the referee is in store.
IE; I have a 1987 El Camino that came with a 305 V8, I have a 2002 5.3 truck motor for it. It is a direct swap since it is a truck to truck and a newer motor. I must smog it as a 2002 now.
I put a 4.3 into an S10 Blazer that had a 2.8ltr. Same family motor, newer year, passed smog with flying colors!!
Do the gas and don't tell