mirror of
https://github.com/jerryscript-project/jerryscript.git
synced 2025-12-15 16:29:21 +00:00
The project is relying on a variant of fdlibm, which has aleady been edited but never verified for correctness. This patch adds unit testing of fdlibm by: * introducing a test generator that uses a trusted libm implementation to calculate correct and expected results of math functions (tools/gen-test-fdlibm.sh and tools/unit-tests/gen-test-fdlibm.c), * adding tests created with the generator that stress all publicly exported functions of jerry's fdlibm (tests/unit/test-fdlibm.inc.h), and * adding a unit test file to drive the generated tests (tests/unit/test-fdlibm.c). Note: The test generator is not expected to be executed often, thus it is not wired into the build system. If it gets edited, it must be used locally to re-generate the .inc.h file. During development, it turned out that tests/unit/test-common.h included the system header math.h, which was only a bad smell until now but became a real header conflict issue with the introduction of the fdlibm unit test. Thus, this patch also changes the include to fdlibm-math.h. JerryScript-DCO-1.0-Signed-off-by: Akos Kiss akiss@inf.u-szeged.hu