MCPcopy Create free account
hub / github.com/Project-LemonLime/Project_LemonLime / testGetCompilerPath

Method testGetCompilerPath

tests/test1/main.cpp:203–229  ·  view source on GitHub ↗

------------------------------------------------------------------ Test 2: get compiler path ------------------------------------------------------------------

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 5

createSettingsFunction · 0.85
getCompilerNameMethod · 0.80
getCompilerLocationMethod · 0.80
getCompilerListMethod · 0.45

Tested by

no test coverage detected