I would like to have latexmk to fail on undefined references/citations. My initial thoughts were to accomplish this by checking the final output for "Reference ... undefined" warnings and exiting with non-zero status.
I've just added this possibility to
latexmk. A new version 4.55a is now available for testing from http://personal.psu.edu/jcc8/latexmk/versions.html For details, see the documentation for the option
-Werror and for the configuration variable
$warnings_as_errors. When the option
-Werror is used, warnings about undefined references or citations or multiply defined references result in a non-zero status code (indicating an error) being returned by
latexmk to the operating system. The warnings are those on the last run of
(pdf)latex, when for an error-free document all references and citations should have become defined.
In addition, I've given a way for getting a visual indicator in preview-continuous mode for these same warnings about references and citations. See the documentation for the variables
$success_cmd. I find this addition very useful.