You basically measure the light source with a spectrophotometer, then perform the procedure in https://en.wikipedia.org/wiki/Color_rendering_index
Alternatively you buy a ColorChecker chart and measure the reflected light with a colorimeter.
Basically, the finer the color separation, wider the gamut, and whiter the light, the higher the CRI.