1#!/usr/bin/env python 2 3# Copyright (C) 2001-2012 Artifex Software, Inc. 4# All Rights Reserved. 5# 6# This software is provided AS-IS with no warranty, either express or 7# implied. 8# 9# This software is distributed under license and may not be copied, 10# modified or distributed except as expressly authorized under the terms 11# of the license contained in the file LICENSE in this distribution. 12# 13# Refer to licensing information at http://www.artifex.com or contact 14# Artifex Software, Inc., 7 Mt. Lassen Drive - Suite A-134, San Rafael, 15# CA 94903, U.S.A., +1(415)492-9861, for further information. 16# 17 18# $Id: gscheck_raster.py 6300 2005-12-28 19:56:24Z giles $ 19 20# 21# gscheck_raster.py 22# 23# rasterizes input files in several configurations and checks them 24# against known baselines 25# 26 27myself="gscheck_testfiles.py" 28import sys, os 29import gsconf, gstestutils 30 31 32def add_compare_test(suite, gsroot, testfile, device, dpi, band, track, now=None): 33 34 logdir=gsconf.logdir 35 if now == None: 36 now=time.strftime("%Y-%m-%d-%H:%M:%S", time.localtime()) 37 prefix=logdir+now+"." 38 39 log_stdout=prefix+gsconf.gs_stdout 40 log_stderr=prefix+gsconf.gs_stderr 41 42 suite.addTest(GSCompareTestCase(gsroot=gsroot, 43 file=gsconf.comparefiledir + testfile, 44 device=device,dpi=dpi,band=band, 45 log_stdout=log_stdout, 46 log_stderr=log_stderr, 47 track_daily=track,now=now) 48 ) 49 50def addTests(suite,gsroot,now,options=None, **args): 51 if args.has_key('track'): 52 track = args['track'] 53 else: 54 track = 0 55 56 # get a list of test files 57 comparefiles = os.listdir(gsconf.comparefiledir) 58 comparefiles.sort() 59 60 if sys.modules["gsconf"].__dict__.has_key("revision"): 61 print myself,gsconf.revision 62 63# for testfile in comparefiles: 64# print myself,testfile 65 66 for testfile in comparefiles: 67 if gsutil.check_extension(testfile): 68 print testfile 69 70if __name__ == '__main__': 71 gstestutils.gsRunTestsMain(addTests) 72