def ctestReportDiff(imdiff, imtype=-1, oss=None):
    """write ctest tag for image difference value"""
    tag = '<DartMeasurement name="ImageError" type="numeric/double"> %f </DartMeasurement>\n'%(imdiff)
    if (imtype <= 0):
        tag += '<DartMeasurement name="BaselineImage" type="text/string">Standard</DartMeasurement>'
    else:
       tag += '<DartMeasurement name="BaselineImage" type="numeric/integer"> %d </DartMeasurement>'%(imtype)
    if oss is not None:
        oss.write(tag)
    return tag