From e46405493730340980fbb496fa80ff4e73f2886f Mon Sep 17 00:00:00 2001 From: Alexander Lohnau Date: Tue, 23 Feb 2021 12:27:25 +0100 Subject: [PATCH] calculatorrunner: Fix autotests if Qalculate is not found This is the case on the BSD CI build. You can try this out with the `-DCMAKE_DISABLE_FIND_PACKAGE_Qalculate=1` cmake flag and the tests still pass. --- runners/calculator/autotests/calculatorrunnertest.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/runners/calculator/autotests/calculatorrunnertest.cpp b/runners/calculator/autotests/calculatorrunnertest.cpp index e0164615d..bcc1163b7 100644 --- a/runners/calculator/autotests/calculatorrunnertest.cpp +++ b/runners/calculator/autotests/calculatorrunnertest.cpp @@ -48,7 +48,9 @@ void CalculatorRunnerTest::testQuery_data() QTest::newRow("simple power") << "2^3" << "8"; QTest::newRow("x as multiplication sign") << "25x4" << "100"; +#ifdef ENABLE_QALCULATE QTest::newRow("single digit factorial") << "5!" << "120"; +#endif QTest::newRow("hex to decimal lower case") << "0xf" << "15"; QTest::newRow("hex to decimal upper case") << "0xF" << "15"; @@ -64,6 +66,9 @@ void CalculatorRunnerTest::testQuery_data() void CalculatorRunnerTest::testApproximation() { +#ifndef ENABLE_QALCULATE + QSKIP("Approximations are only with Qalculate supported"); +#endif launchQuery("5^1234567"); QCOMPARE(manager->matches().size(), 1); QCOMPARE(manager->matches().constFirst().subtext(), "Approximation");