50
50
help = 'use debug build' );
51
51
parser .add_argument ('-t' , '--test' , '--test-build' , action = 'store_true' ,
52
52
help = 'use test build' )
53
+ parser .add_argument ('-f' , '--full' , '--chakrafull' , action = 'store_true' ,
54
+ help = 'test chakrafull instead of chakracore' )
53
55
parser .add_argument ('--static' , action = 'store_true' ,
54
56
help = 'mark that we are testing a static build' )
55
57
parser .add_argument ('--variants' , metavar = 'variant' , nargs = '+' ,
78
80
help = 'use x86 build' )
79
81
parser .add_argument ('--x64' , action = 'store_true' ,
80
82
help = 'use x64 build' )
83
+ parser .add_argument ('--arm' , action = 'store_true' ,
84
+ help = 'use arm build' )
85
+ parser .add_argument ('--arm64' , action = 'store_true' ,
86
+ help = 'use arm64 build' )
81
87
parser .add_argument ('-j' , '--processcount' , metavar = 'processcount' , type = int ,
82
88
help = 'number of parallel threads to use' )
83
89
parser .add_argument ('--warn-on-timeout' , action = 'store_true' ,
84
90
help = 'warn when a test times out instead of labelling it as an error immediately' )
85
91
parser .add_argument ('--override-test-root' , type = str ,
86
92
help = 'change the base directory for the tests (where rlexedirs will be sought)' )
93
+ parser .add_argument ('--extra-flags' , type = str ,
94
+ help = 'add extra flags to all executed tests' )
87
95
args = parser .parse_args ()
88
96
89
97
test_root = os .path .dirname (os .path .realpath (__file__ ))
93
101
if args .override_test_root :
94
102
test_root = os .path .realpath (args .override_test_root )
95
103
96
- # arch: x86, x64
97
- arch = 'x86' if args .x86 else ('x64' if args .x64 else None )
104
+ # arch: x86, x64, arm, arm64
105
+ arch = None
106
+ if args .x86 :
107
+ arch = 'x86'
108
+ elif args .x64 :
109
+ arch = 'x64'
110
+ elif args .arm :
111
+ arch = 'arm'
112
+ elif args .arm64 :
113
+ arch = 'arm64'
114
+
98
115
if arch == None :
99
116
arch = os .environ .get ('_BuildArch' , 'x86' )
100
117
if sys .platform != 'win32' :
110
127
sys .exit (1 )
111
128
flavor_alias = 'chk' if flavor == 'Debug' else 'fre'
112
129
130
+ # handling for extra flags
131
+ extra_flags = []
132
+ if args .extra_flags :
133
+ extra_flags = args .extra_flags .split ()
134
+
113
135
# test variants
114
136
if not args .variants :
115
137
args .variants = ['interpreted' , 'dynapogo' ]
116
138
139
+ # target binary variants
140
+ binary_name_noext = "ch"
141
+ if args .full :
142
+ binary_name_noext = "jshost"
143
+ repo_root = os .path .dirname (repo_root )
144
+ # we need this to have consistent error message formatting with ch
145
+ extra_flags .append ("-bvt" )
146
+ else :
147
+ extra_flags .append ('-WERExceptionSupport' )
148
+
149
+ # append exe to the binary name on windows
150
+ binary_name = binary_name_noext
151
+ if sys .platform == 'win32' :
152
+ binary_name = binary_name + ".exe"
153
+
117
154
# binary: full ch path
118
155
binary = args .binary
119
156
if binary == None :
120
157
if sys .platform == 'win32' :
121
158
build = "VcBuild.SWB" if args .swb else "VcBuild"
122
- binary = 'Build\\ ' + build + ' \\ bin\\ {}_{}\\ ch.exe ' .format (arch , flavor )
159
+ binary = os . path . join ( repo_root , 'Build' , build , ' bin' , ' {}_{}' .format (arch , flavor ), binary_name )
123
160
else :
124
- binary = 'out/{0}/ch' . format ( flavor )
125
- binary = os . path . join ( repo_root , binary )
161
+ binary = os . path . join ( repo_root , 'out' , flavor , binary_name )
162
+
126
163
if not os .path .isfile (binary ):
127
164
print ('{} not found. Did you run ./build.sh already?' .format (binary ))
128
165
sys .exit (1 )
129
166
130
167
# global tags/not_tags
131
168
tags = set (args .tag or [])
132
- not_tags = set (args .not_tag or []).union (['fail' , 'exclude_' + arch , 'exclude_' + flavor , 'exclude_ch' ])
169
+ not_tags = set (args .not_tag or []).union (['fail' , 'exclude_' + arch , 'exclude_' + flavor ])
133
170
134
171
if arch_alias :
135
172
not_tags .add ('exclude_' + arch_alias )
158
195
else :
159
196
not_tags .add ('exclude_windows' )
160
197
198
+ # exclude tests that depend on features not supported on a platform
199
+ if arch == 'arm' or arch == 'arm64' :
200
+ not_tags .add ('require_asmjs' )
201
+
202
+ # exclude tests that exclude the current binary
203
+ not_tags .add ('exclude_' + binary_name_noext )
204
+
205
+ # exclude tests known to fail under certain sanitizers
161
206
if args .sanitize != None :
162
207
not_tags .add ('exclude_sanitize_' + args .sanitize )
163
208
@@ -204,7 +249,7 @@ def __init__(self, log_file_path = None):
204
249
# Set up the log file paths
205
250
# Make sure the right directory exists and the log file doesn't
206
251
log_file_name = "testrun.{0}{1}.log" .format (arch , flavor )
207
- log_file_directory = os .path .join (repo_root , "test" , "logs" )
252
+ log_file_directory = os .path .join (test_root , "logs" )
208
253
209
254
if not os .path .exists (log_file_directory ):
210
255
os .mkdir (log_file_directory )
@@ -306,7 +351,7 @@ class TestVariant(object):
306
351
def __init__ (self , name , compile_flags = [], variant_not_tags = []):
307
352
self .name = name
308
353
self .compile_flags = \
309
- ['-WERExceptionSupport' , '- ExtendedErrorStackForTestHost' ,
354
+ ['-ExtendedErrorStackForTestHost' ,
310
355
'-BaselineMode' ] + compile_flags
311
356
self ._compile_flags_has_expansion = self ._has_expansion (compile_flags )
312
357
self .tags = tags .copy ()
@@ -318,6 +363,11 @@ def __init__(self, name, compile_flags=[], variant_not_tags=[]):
318
363
self .test_count = 0
319
364
self ._print_lines = [] # _print lines buffer
320
365
self ._last_len = 0
366
+ if verbose :
367
+ print ("Added variant {0}:" .format (name ))
368
+ print ("Flags: " + ", " .join (self .compile_flags ))
369
+ print ("Tags: " + ", " .join (self .tags ))
370
+ print ("NotTags: " + ", " .join (self .not_tags ))
321
371
322
372
@staticmethod
323
373
def _has_expansion (flags ):
@@ -506,7 +556,7 @@ def timeout_func(timeout_data):
506
556
return self ._show_failed (timedout = True , ** fail_args )
507
557
508
558
# check ch failed
509
- if exit_code != 0 :
559
+ if exit_code != 0 and binary_name_noext == 'ch' :
510
560
return self ._show_failed (** fail_args )
511
561
512
562
# check output
@@ -706,19 +756,19 @@ def main():
706
756
707
757
# test variants
708
758
variants = [x for x in [
709
- TestVariant ('interpreted' , [
759
+ TestVariant ('interpreted' , extra_flags + [
710
760
'-maxInterpretCount:1' , '-maxSimpleJitRunCount:1' , '-bgjit-' ,
711
761
'-dynamicprofilecache:profile.dpl.${id}'
712
762
], [
713
763
'require_disable_jit'
714
764
]),
715
- TestVariant ('dynapogo' , [
765
+ TestVariant ('dynapogo' , extra_flags + [
716
766
'-forceNative' , '-off:simpleJit' , '-bgJitDelay:0' ,
717
767
'-dynamicprofileinput:profile.dpl.${id}'
718
768
], [
719
769
'require_disable_jit'
720
770
]),
721
- TestVariant ('disable_jit' , [
771
+ TestVariant ('disable_jit' , extra_flags + [
722
772
'-nonative'
723
773
], [
724
774
'exclude_interpreted' , 'fails_interpreted' , 'require_backend'
0 commit comments