Magnum::DebugTools::CompareMaterial class new in Git master

Material comparator for Corrade::TestSuite.

Compares Trade::MaterialData instances, printing the differences in the two if they have a different type, different layer count, different attributes, and different type or different value of the same attribute. Pass the comparator to CORRADE_COMPARE_AS() along with an actual and expected material:

CORRADE_COMPARE_AS(actual, expected, DebugTools::CompareMaterial);

Based on actual materials used, in case of a comparison failure the comparator can give for example the following output:

Starting MaterialTest with 1 test cases...
  FAIL [1] conversion() at …/debugtools-comparematerial.cpp:65
        Materials actual and expected have different layers. Actual (+) vs expected (-):
       -Types: PbrMetallicRoughness
       +Types: PbrMetallicRoughness|PbrClearCoat
        Base layer:
          BaseColor @ Vector4: {0.851206, 0.687386, 0.416013, 1}
       -  DoubleSided @ Bool: false
       +  DoubleSided @ Bool: true
          Metalness @ Float: 0.603401
          Roughness @ Float: 0.105112
       +Layer 1:
       +   LayerName @ String: ClearCoat
       +  LayerFactor @ Float: 0.02
       +  Roughness @ Float: 0.320856
Finished MaterialTest with 1 errors out of 1 checks.

All Trade::MaterialAttributeType are supported.