Consider the following code:
test[x_] := If[1 < x < 2, Message[Test::message]; x^2, x]; NIntegrate[test[x], {x, 0, 3}] 5.33333333333334
I.e. it gives me the result, suppressing all messages emitted by test. OTOH, this code does emit the messages:
N@Sum[test[x] 1/1000, {x, 0, 3, 1/1000}] Test::message: -- Message text not found --
Test::message: -- Message text not found --
Test::message: -- Message text not found --
General::stop: Further output of Test::message will be suppressed during this calculation.
5.3338335
I'd really like to receive the messages from the integrand. How can I stop NIntegrate from suppressing the messages?