------------------------------------------------------------------ Test 2: get compiler path ------------------------------------------------------------------
| 201 | // Test 2: get compiler path |
| 202 | // ------------------------------------------------------------------ |
| 203 | void testGetCompilerPath() { |
| 204 | Settings *settings = createSettings(this); |
| 205 | |
| 206 | const QList<Compiler *> &compilers = settings->getCompilerList(); |
| 207 | QVERIFY2(compilers.size() >= 2, "Expected at least 2 compilers (g++ and python)"); |
| 208 | |
| 209 | bool foundGpp = false; |
| 210 | bool foundPython = false; |
| 211 | for (const Compiler *c : compilers) { |
| 212 | if (c->getCompilerName() == "g++") { |
| 213 | QVERIFY2(! c->getCompilerLocation().isEmpty(), "g++ location is empty"); |
| 214 | QVERIFY2(QFileInfo(c->getCompilerLocation()).exists(), |
| 215 | qPrintable("g++ not found at: " + c->getCompilerLocation())); |
| 216 | foundGpp = true; |
| 217 | } |
| 218 | if (c->getCompilerName() == "python") { |
| 219 | QVERIFY2(! c->getInterpreterLocation().isEmpty(), "python location is empty"); |
| 220 | QVERIFY2(QFileInfo(c->getInterpreterLocation()).exists(), |
| 221 | qPrintable("python not found at: " + c->getInterpreterLocation())); |
| 222 | foundPython = true; |
| 223 | } |
| 224 | } |
| 225 | QVERIFY2(foundGpp, "g++ compiler not found in settings"); |
| 226 | QVERIFY2(foundPython, "python compiler not found in settings"); |
| 227 | |
| 228 | delete settings; |
| 229 | } |
| 230 | |
| 231 | // ------------------------------------------------------------------ |
| 232 | // Test 3 & 4: judge all test cases and check expected output. |
nothing calls this directly
no test coverage detected