diff options
author | Damien George <damien.p.george@gmail.com> | 2017-06-26 13:47:00 +1000 |
---|---|---|
committer | Damien George <damien.p.george@gmail.com> | 2017-06-26 13:47:00 +1000 |
commit | 4a6c0fda784e9de346be92185f2f91b72e31f9db (patch) | |
tree | 4720930117e78d58125ba06c7807c10e38778eab /tests/feature_check | |
parent | c408ed9fb1e9922bedb02b9b4b3b441d6db8dc74 (diff) | |
download | micropython-4a6c0fda784e9de346be92185f2f91b72e31f9db.tar.gz micropython-4a6c0fda784e9de346be92185f2f91b72e31f9db.zip |
tests: Auto detect floating point capabilites of the target.
The floating-point precision of the target is detected (0, 30, 32 or 64)
and only those tests which can run on the target will be run.
Diffstat (limited to 'tests/feature_check')
-rw-r--r-- | tests/feature_check/float.py | 13 | ||||
-rw-r--r-- | tests/feature_check/float.py.exp | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/tests/feature_check/float.py b/tests/feature_check/float.py new file mode 100644 index 0000000000..af93f59763 --- /dev/null +++ b/tests/feature_check/float.py @@ -0,0 +1,13 @@ +# detect how many bits of precision the floating point implementation has + +try: + float +except NameError: + print(0) +else: + if float('1.0000001') == float('1.0'): + print(30) + elif float('1e300') == float('inf'): + print(32) + else: + print(64) diff --git a/tests/feature_check/float.py.exp b/tests/feature_check/float.py.exp new file mode 100644 index 0000000000..900731ffd5 --- /dev/null +++ b/tests/feature_check/float.py.exp @@ -0,0 +1 @@ +64 |