Since I have to study the variation of the gasUsed of a function, using Truffle Test is it possible to do a test that runs n times the same function without going out of gas or exceding the block gas limit?
Unless you configure your TestRPC/Ganache otherwise (auto-mining every X seconds), there will only be one transaction per block, so blockgas limit should not be the problem.
To check the variations of used gas, you can do something like this (pseudocode):
arrayWithParameters[];
for (i=0; i<arrayWithParameters[].length; i++) {
let transaction = await yourContract.function(arrayWithParameters[i]);
checkGasOf(transaction);
}