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__ ))
94
102
test_root = os .path .realpath (args .override_test_root )
95
103
96
104
# arch: x86, x64
97
- arch = 'x86' if args .x86 else ('x64' if args .x64 else None )
105
+ arch = 'x86' if args .x86 else ('x64' if args .x64 else ( 'arm' if args . arm else ( 'arm64' if args . arm64 else None )) )
98
106
if arch == None :
99
107
arch = os .environ .get ('_BuildArch' , 'x86' )
100
108
if sys .platform != 'win32' :
110
118
sys .exit (1 )
111
119
flavor_alias = 'chk' if flavor == 'Debug' else 'fre'
112
120
121
+ # handling for extra flags
122
+ extra_flags = []
123
+ if args .extra_flags :
124
+ extra_flags = args .extra_flags .split ()
125
+
113
126
# test variants
114
127
if not args .variants :
115
128
args .variants = ['interpreted' , 'dynapogo' ]
116
129
130
+ # target binary variants
131
+ binary_name_noext = "ch"
132
+ if args .full :
133
+ binary_name_noext = "jshost"
134
+ repo_root = os .path .dirname (repo_root )
135
+ # we need this to have consistent error message formatting with ch
136
+ extra_flags .append ("-bvt" )
137
+ else :
138
+ extra_flags .append ('-WERExceptionSupport' )
139
+
140
+ # append exe to the binary name on windows
141
+ binary_name = binary_name_noext
142
+ if sys .platform == 'win32' :
143
+ binary_name = binary_name + ".exe"
144
+
117
145
# binary: full ch path
118
146
binary = args .binary
119
147
if binary == None :
120
148
if sys .platform == 'win32' :
121
149
build = "VcBuild.SWB" if args .swb else "VcBuild"
122
- binary = 'Build\\ ' + build + ' \\ bin\\ {}_{}\\ ch.exe ' .format (arch , flavor )
150
+ binary = os . path . join ( 'Build' , build , ' bin' , ' {}_{}' .format (arch , flavor ), binary_name )
123
151
else :
124
- binary = 'out/ {0}/ch ' .format (flavor )
152
+ binary = os . path . join ( 'out' , ' {0}' .format (flavor ), binary_name )
125
153
binary = os .path .join (repo_root , binary )
126
154
if not os .path .isfile (binary ):
127
155
print ('{} not found. Did you run ./build.sh already?' .format (binary ))
128
156
sys .exit (1 )
129
157
130
158
# global tags/not_tags
131
159
tags = set (args .tag or [])
132
- not_tags = set (args .not_tag or []).union (['fail' , 'exclude_' + arch , 'exclude_' + flavor , 'exclude_ch' ])
160
+ not_tags = set (args .not_tag or []).union (['fail' , 'exclude_' + arch , 'exclude_' + flavor ])
133
161
134
162
if arch_alias :
135
163
not_tags .add ('exclude_' + arch_alias )
158
186
else :
159
187
not_tags .add ('exclude_windows' )
160
188
189
+ # exclude tests that depend on features not supported on a platform
190
+ if arch == 'arm' or arch == 'arm64' :
191
+ not_tags .add ('require_asmjs' )
192
+
193
+ # exclude tests that exclude the current binary
194
+ not_tags .add ('exclude_' + binary_name_noext )
195
+
196
+ # exclude tests known to fail under certain sanitizers
161
197
if args .sanitize != None :
162
198
not_tags .add ('exclude_sanitize_' + args .sanitize )
163
199
@@ -204,7 +240,7 @@ def __init__(self, log_file_path = None):
204
240
# Set up the log file paths
205
241
# Make sure the right directory exists and the log file doesn't
206
242
log_file_name = "testrun.{0}{1}.log" .format (arch , flavor )
207
- log_file_directory = os .path .join (repo_root , "test" , "logs" )
243
+ log_file_directory = os .path .join (test_root , "logs" )
208
244
209
245
if not os .path .exists (log_file_directory ):
210
246
os .mkdir (log_file_directory )
@@ -306,7 +342,7 @@ class TestVariant(object):
306
342
def __init__ (self , name , compile_flags = [], variant_not_tags = []):
307
343
self .name = name
308
344
self .compile_flags = \
309
- ['-WERExceptionSupport' , '- ExtendedErrorStackForTestHost' ,
345
+ ['-ExtendedErrorStackForTestHost' ,
310
346
'-BaselineMode' ] + compile_flags
311
347
self ._compile_flags_has_expansion = self ._has_expansion (compile_flags )
312
348
self .tags = tags .copy ()
@@ -318,6 +354,11 @@ def __init__(self, name, compile_flags=[], variant_not_tags=[]):
318
354
self .test_count = 0
319
355
self ._print_lines = [] # _print lines buffer
320
356
self ._last_len = 0
357
+ if verbose :
358
+ print ("Added variant {0}:" .format (name ))
359
+ print ("Flags: " + ", " .join (self .compile_flags ))
360
+ print ("Tags: " + ", " .join (self .tags ))
361
+ print ("NotTags: " + ", " .join (self .not_tags ))
321
362
322
363
@staticmethod
323
364
def _has_expansion (flags ):
@@ -506,7 +547,7 @@ def timeout_func(timeout_data):
506
547
return self ._show_failed (timedout = True , ** fail_args )
507
548
508
549
# check ch failed
509
- if exit_code != 0 :
550
+ if exit_code != 0 and binary_name_noext == 'ch' :
510
551
return self ._show_failed (** fail_args )
511
552
512
553
# check output
@@ -706,19 +747,19 @@ def main():
706
747
707
748
# test variants
708
749
variants = [x for x in [
709
- TestVariant ('interpreted' , [
750
+ TestVariant ('interpreted' , extra_flags + [
710
751
'-maxInterpretCount:1' , '-maxSimpleJitRunCount:1' , '-bgjit-' ,
711
752
'-dynamicprofilecache:profile.dpl.${id}'
712
753
], [
713
754
'require_disable_jit'
714
755
]),
715
- TestVariant ('dynapogo' , [
756
+ TestVariant ('dynapogo' , extra_flags + [
716
757
'-forceNative' , '-off:simpleJit' , '-bgJitDelay:0' ,
717
758
'-dynamicprofileinput:profile.dpl.${id}'
718
759
], [
719
760
'require_disable_jit'
720
761
]),
721
- TestVariant ('disable_jit' , [
762
+ TestVariant ('disable_jit' , extra_flags + [
722
763
'-nonative'
723
764
], [
724
765
'exclude_interpreted' , 'fails_interpreted' , 'require_backend'
0 commit comments