Origin: https://salsa.debian.org/debian/fuzzylite/-/blob/debian/6.0+dfsg-6/debian/patches/when-testing-large-float-numbers-for-equ.patch From: Johannes 'josch' Schauer Date: Sun, 3 Feb 2019 10:33:22 +0100 X-Dgit-Generated: 6.0+dfsg-2 80960ae38da9db032dfbfec6405398653e8205ff Subject: when testing large float numbers for equality, use a larger epsilon --- --- fuzzylite-6.0+dfsg.orig/fuzzylite/test/BenchmarkTest.cpp +++ fuzzylite-6.0+dfsg/fuzzylite/test/BenchmarkTest.cpp @@ -96,7 +96,17 @@ namespace fl { CHECK(Op::isEq(1.0, Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds))); FL_LOG(Benchmark::convert(1000.0, Benchmark::MilliSeconds, Benchmark::Seconds)); - CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds))); + scalar eps = +#ifndef __i386__ + fuzzylite::macheps(); +#else + // on i386, due to the 80bit x87 register, double floating point + // numbers are handled differently and thus the difference between + // 35e9 and the result of Benchmark::convert() will be 2.179e-6, + // which is greater than the default epsilon of 1e-6. + 1e-5; +#endif + CHECK(Op::isEq(35e9, Benchmark::convert(35, Benchmark::Seconds, Benchmark::NanoSeconds), eps)); CHECK(Op::isEq(35, Benchmark::convert(35e9, Benchmark::NanoSeconds, Benchmark::Seconds))); } -driver.scm?id=d762e1c88c7a65417fed6f58a43bd312dc28ddcd'>diff
path: root/build-aux/test-driver.scm
AgeCommit message (Expand)Author
2021-02-02build: Add a --show-duration option to the SCM test-driver....* build-aux/test-driver.scm (script-version): Update. (show-help): Document it. (%options): Add the 'show-duration' option. (test-runner-gnu): Pass as a new argument. [test-cases-start-time]: New inner variable. [test-on-test-begin-gnu]: New hook, used to record the start time. [test-on-test-end-gnu]: Conditionally print elapsed time. Record it as the optional metadata in the test result file (.trs). * doc/guix.texi (Running the Test Suite): Document it. Maxim Cournoyer
2021-01-31build: test-driver.scm: Allow running as a standalone script....* build-aux/test-driver.scm: Add an exec-based shebang and set the script executable bit. (main): Insert a newline after the version string is printed with --version. Maxim Cournoyer
2021-01-31build: test-driver.scm: Add a new '--errors-only' option....* build-aux/test-driver.scm (show-help): Add the help text for the new '--errors-only' option. (%options): Add the errors-only option. (test-runner-gnu): Add the errors-only? parameter and update doc. Move the logging of the test data after the test has completed, so a choice can be made whether to keep it or discard it based on the value of the test result. (main): Pass the errors-only? option to the driver. * doc/guix.texi (Running the Test Suite): Document the new option. Maxim Cournoyer
2021-01-31build: test-driver.scm: Add test cases filtering options....* build-aux/test-driver.scm (show-help): Add help text for the new --select and --exclude options. (%options): Add the new select and exclude options. (test-runner-gnu): Pass them to the test runner. Update doc. (test-match-name*, test-match-name*/negated, %test-match-all): New variables. (main): Compute the test specifier based on the values of the new options and apply it to the current test runner when running the test file. * doc/guix.texi (Running the Test Suite): Document the new options. Maxim Cournoyer
2021-01-31build: test-driver.scm: Enable colored test results by default....The Automake parallel test harness does its own smart detection of the terminal color capability and always provides the --color-tests argument to the driver. This change defaults the --color-tests argument to true when the test driver is run on its own (not via Automake). * build-aux/test-driver.scm (main): Set the default value of the --color-tests argument to true when it's not explicitly provided. Maxim Cournoyer
2021-01-31build: test-driver.scm: Make output redirection optional....This makes it easier (and less surprising) for users to experiment with the custom Scheme test driver directly. The behavior is unchanged from Automake's point of view. * build-aux/test-driver.scm (main): Make the --log-file and --trs-file arguments optional and update doc. Only open, redirect and close a port to a log file when the --log-file option is provided. Only open and close a port to a trs file when the --trs-file option is provided. (test-runner-gnu): Set OUT-PORT parameter default value to the current output port. Set the TRS-PORT parameter default value to a void port. Update doc. Maxim Cournoyer