Render multiple material previews
This code will animate (cycle) through all materials based on current frame value. Run this in Text editor, select some object (it works on active object), set frame range from 0 to number_of_materials-1 and render the animation as images.

import bpy

def my_handler(scene):
    if bpy.data.materials:
        ob = bpy.context.active_object
        mat = bpy.data.materials[min(len(bpy.data.materials)-1, scene.frame_current)]
        if len(ob.data.materials):
            ob.data.materials[0] = mat
        else:
            ob.data.materials.append(mat)

bpy.app.handlers.frame_change_pre.append(my_handler)