File indexing completed on 2024-05-12 08:00:23
0001 /* Copyright (c) 2019 Shlomi Fish 0002 * 0003 * Permission is hereby granted, free of charge, to any person 0004 * obtaining a copy of this software and associated documentation 0005 * files (the "Software"), to deal in the Software without 0006 * restriction, including without limitation the rights to use, 0007 * copy, modify, merge, publish, distribute, sublicense, and/or sell 0008 * copies of the Software, and to permit persons to whom the 0009 * Software is furnished to do so, subject to the following 0010 * conditions: 0011 * 0012 * The above copyright notice and this permission notice shall be 0013 * included in all copies or substantial portions of the Software. 0014 * 0015 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 0016 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 0017 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND 0018 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT 0019 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, 0020 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 0021 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 0022 * OTHER DEALINGS IN THE SOFTWARE. 0023 */ 0024 #include <QProcess> 0025 #include <QTest> 0026 0027 class TestSolver: public QObject 0028 { 0029 Q_OBJECT 0030 private Q_SLOTS: 0031 void runSolver(); 0032 }; 0033 0034 void TestSolver::runSolver() 0035 { 0036 QProcess kpat; 0037 kpat.start(QStringLiteral("../bin/kpat"), QStringList() << QStringLiteral("--start") << "1" << QStringLiteral("--end") << "3" << QStringLiteral("--solve") << QStringLiteral("Freecell")); 0038 QCOMPARE(kpat.waitForFinished(), true); 0039 QCOMPARE(kpat.exitStatus(), QProcess::NormalExit); 0040 QCOMPARE(kpat.exitCode(), 0); 0041 } 0042 0043 QTEST_MAIN(TestSolver) 0044 #include "solve_by_name.moc"