File: works.py

package info (click to toggle)
opencv 2.1.0-3%2Bsqueeze1
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 68,800 kB
  • ctags: 52,010
  • sloc: cpp: 554,793; xml: 475,942; ansic: 153,396; python: 18,622; sh: 428; makefile: 111
file content (29 lines) | stat: -rwxr-xr-x 885 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# needed for access() and remove()
import os

# check for required featurest listet in 'filelist' and removes the old .works file of 'testname'
def check_files( filelist, testname ):
	# delete old .works file of the calling test, if it exists
	filename = "./"+testname+".works"

	if os.access(filename,os.F_OK):
		os.remove(filename)

	# now check for existint .works files
	if len(filelist) > 0:
		for i in range(0,len(filelist)):
			tmpname = "./"+filelist[i]+".works"
			if not os.access(tmpname,os.F_OK):
				print "(INFO) Skipping '"+testname+"' due to SKIP/FAIL of '"+filelist[i]+"'"
				return False

	# either the filelist is empty (no requirements) or all requirements match
	return True

	
# create the .works file for test 'testname'
def set_file( testname ):
	# create .works file of calling test
	works_file = file("./"+testname+".works", 'w',1)
	works_file.close
	return