@@ -239,6 +239,7 @@ def run_tests(pyb, tests, args, base_path="."):
239239 skip_tests .add ('cmdline/repl_emacs_keys.py' )
240240
241241 upy_byteorder = run_feature_check (pyb , args , base_path , 'byteorder.py' )
242+ upy_float_precision = int (run_feature_check (pyb , args , base_path , 'float.py' ))
242243 has_complex = run_feature_check (pyb , args , base_path , 'complex.py' ) == b'complex\n '
243244 has_coverage = run_feature_check (pyb , args , base_path , 'coverage.py' ) == b'coverage\n '
244245 cpy_byteorder = subprocess .check_output ([CPYTHON3 , base_path + '/feature_check/byteorder.py' ])
@@ -252,6 +253,19 @@ def run_tests(pyb, tests, args, base_path="."):
252253 skip_tests .add ('thread/stress_heap.py' ) # has reliability issues
253254 skip_tests .add ('thread/stress_recurse.py' ) # has reliability issues
254255
256+ if upy_float_precision == 0 :
257+ skip_tests .add ('extmod/ujson_dumps_float.py' )
258+ skip_tests .add ('extmod/ujson_loads_float.py' )
259+ skip_tests .add ('misc/rge_sm.py' )
260+ if upy_float_precision < 32 :
261+ skip_tests .add ('float/float2int_intbig.py' ) # requires fp32, there's float2int_fp30_intbig.py instead
262+ skip_tests .add ('float/string_format.py' ) # requires fp32, there's string_format_fp30.py instead
263+ skip_tests .add ('float/bytes_construct.py' ) # requires fp32
264+ skip_tests .add ('float/bytearray_construct.py' ) # requires fp32
265+ if upy_float_precision < 64 :
266+ skip_tests .add ('float/float_divmod.py' ) # tested by float/float_divmod_relaxed.py instead
267+ skip_tests .add ('float/float2int_doubleprec_intbig.py' )
268+
255269 if not has_complex :
256270 skip_tests .add ('float/complex1.py' )
257271 skip_tests .add ('float/complex1_intbig.py' )
@@ -272,8 +286,6 @@ def run_tests(pyb, tests, args, base_path="."):
272286 # Some tests shouldn't be run on pyboard
273287 if pyb is not None :
274288 skip_tests .add ('basics/exception_chain.py' ) # warning is not printed
275- skip_tests .add ('float/float_divmod.py' ) # tested by float/float_divmod_relaxed.py instead
276- skip_tests .add ('float/float2int_doubleprec_intbig.py' ) # requires double precision floating point to work
277289 skip_tests .add ('micropython/meminfo.py' ) # output is very different to PC output
278290 skip_tests .add ('extmod/machine_mem.py' ) # raw memory access not supported
279291
@@ -282,19 +294,12 @@ def run_tests(pyb, tests, args, base_path="."):
282294 skip_tests .add ('misc/recursion.py' ) # requires stack checking enabled
283295 skip_tests .add ('misc/recursive_data.py' ) # requires stack checking enabled
284296 skip_tests .add ('misc/recursive_iternext.py' ) # requires stack checking enabled
285- skip_tests .add ('misc/rge_sm.py' ) # requires floating point
286297 skip_tests .update ({'extmod/uctypes_%s.py' % t for t in 'bytearray le native_le ptr_le ptr_native_le sizeof sizeof_native array_assign_le array_assign_native_le' .split ()}) # requires uctypes
287298 skip_tests .add ('extmod/zlibd_decompress.py' ) # requires zlib
288- skip_tests .add ('extmod/ujson_dumps_float.py' ) # requires floating point
289- skip_tests .add ('extmod/ujson_loads_float.py' ) # requires floating point
290299 skip_tests .add ('extmod/uheapq1.py' ) # uheapq not supported by WiPy
291300 skip_tests .add ('extmod/urandom_basic.py' ) # requires urandom
292301 skip_tests .add ('extmod/urandom_extra.py' ) # requires urandom
293302 elif args .target == 'esp8266' :
294- skip_tests .add ('float/float2int_intbig.py' ) # requires at least fp32, there's float2int_fp30_intbig.py instead
295- skip_tests .add ('float/string_format.py' ) # requires at least fp32, there's string_format_fp30.py instead
296- skip_tests .add ('float/bytes_construct.py' ) # requires fp32
297- skip_tests .add ('float/bytearray_construct.py' ) # requires fp32
298303 skip_tests .add ('misc/rge_sm.py' ) # too large
299304 elif args .target == 'minimal' :
300305 skip_tests .add ('misc/rge_sm.py' ) # too large
0 commit comments