-
Notifications
You must be signed in to change notification settings - Fork 59
/
Copy pathlist-available-results
executable file
·67 lines (49 loc) · 2.17 KB
/
list-available-results
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
#!/usr/bin/env python3
import pickle
from os import listdir
import os
import json
DATA_DIR = 'data'
RELVALS_DIR = 'relvals'
UNIT_TESTS_DIR = 'unitTests'
SCRAM_DIR = 'scram'
#
# creates a dictionary from the results that it found in testsDir
#
def get_dict_available_results( testsDir ):
resultsDict = {}
if not os.path.exists( DATA_DIR + '/' + testsDir ):
print( 'Directory not found: ' + DATA_DIR + '/' + testsDir )
return resultsDict
for current_arch in listdir( DATA_DIR + '/' + testsDir ):
for current_date in listdir( DATA_DIR + '/' + testsDir + '/' + current_arch ):
for current_release in listdir( DATA_DIR + '/' + testsDir + '/' + current_arch + '/' + current_date ):
current_ib = current_release.rstrip( '.json' ) + '_' + current_date
# to avoid confusing the INCOMPLETE, and EXCEPTIONS suffixes with a flavor
if '_INCOMPLETE' in current_ib:
current_ib = current_ib.replace( '_INCOMPLETE', '' ) + '_INCOMPLETE'
if '_EXCEPTIONS' in current_ib:
current_ib = current_ib.replace( '_EXCEPTIONS', '' ) + '_EXCEPTIONS'
if resultsDict.get( current_ib ):
resultsDict[ current_ib ] += ','+current_arch
else:
resultsDict[ current_ib ] = current_arch
print ('found results in ', testsDir, ' for: ', current_ib, ';', current_arch)
return resultsDict
#
# Saves the file in the desired directory
#
def saveDict( fileName, data):
out_json = open( fileName , "w" )
json.dump( data, out_json, sort_keys=True, indent=4 )
out_json.close()
#-----------------------------------------------------------------------------------
#---- Start
#-----------------------------------------------------------------------------------
if __name__ == "__main__":
available_results_relvals = get_dict_available_results( RELVALS_DIR )
saveDict( 'data/RelvalsAvailableResults.json', available_results_relvals)
available_results_utests = get_dict_available_results( UNIT_TESTS_DIR )
saveDict( 'data/UnitTestsAvailableResults.json', available_results_utests)
available_results_scram = get_dict_available_results( SCRAM_DIR )
saveDict( 'data/ScramAvailableResults.json', available_results_scram)