If I understand correctly, you check for the presence of the .mllib file. This is a good start but mainly checking the effect rather than the cause. What about testing for the absence of the bug 1239: turn warning 31 into an error using the good command line option of ocamlc and compile a piece of example code. It should fail if the bug is here. 

Have a look at test/TestFull (esp. the last tests), to setup and compile an test code.