Of course it's a thing (it's just unsearchable, because search engines don't handle meaningful differences in word order well).
Automation is code that does things you would otherwise have to do by hand. Spoken loosely, that covers all computer programs, so we usually use it to mean "code that generates other computer-readable assets". And of course it's testable - the same principles of unit testing apply as everywhere else.
Example: If your code generates images, you specify properties of the images you want, e.g. "this image has the same color balance as the other, but is smaller and lower-resolution". If it's log files, you run it and then verify that the log contains the info you wanted to log. And if the output is other computer programs, you an either analyse them statically (without running them) or dynamically (by running them and testing their output). By definition, if that output is satisfactory, then the automation was successful, and that's what you want to ensure.