| 141 | } |
| 142 | |
| 143 | void TestBase::costomScript() { |
| 144 | TestUtils utils; |
| 145 | |
| 146 | #ifdef Q_OS_UNIX |
| 147 | QFile f("./" + DISTRO_DIR + "/bin/TestOnlyC"); |
| 148 | auto comapareTree = utils.createTree( |
| 149 | {"./" + DISTRO_DIR + "/bin/TestOnlyC", |
| 150 | "./" + DISTRO_DIR + "/bin/qt.conf", |
| 151 | "./" + DISTRO_DIR + "/TestOnlyC.sh"}); |
| 152 | QString bin = TestBinDir + "TestOnlyC"; |
| 153 | QString scriptPath = "./" + DISTRO_DIR + "/TestOnlyC.sh"; |
| 154 | |
| 155 | #else |
| 156 | QFile f("./" + DISTRO_DIR + "/TestOnlyC.exe"); |
| 157 | auto comapareTree = utils.createTree( |
| 158 | {"./" + DISTRO_DIR + "/TestOnlyC.exe", |
| 159 | "./" + DISTRO_DIR + "/TestOnlyC.bat", |
| 160 | "./" + DISTRO_DIR + "/qt.conf"}); |
| 161 | QString bin = TestBinDir + "TestOnlyC.exe"; |
| 162 | QString scriptPath = "./" + DISTRO_DIR + "/TestOnlyC.bat"; |
| 163 | |
| 164 | |
| 165 | #endif |
| 166 | |
| 167 | runTestParams({"-bin", bin, "force-clear", "noOverwrite", "-libOut", "lib"}, &comapareTree); |
| 168 | |
| 169 | QFile script(scriptPath); |
| 170 | QVERIFY(script.open(QIODevice::ReadOnly)); |
| 171 | auto scriptText = script.readAll(); |
| 172 | |
| 173 | QVERIFY(!scriptText.contains("Begin Custom Script")); |
| 174 | |
| 175 | script.close(); |
| 176 | |
| 177 | runTestParams({"-bin", bin, "force-clear", "noOverwrite", |
| 178 | "-libOut", "lib", |
| 179 | "-customScript", "echo 'this is test script'"}, &comapareTree); |
| 180 | |
| 181 | QVERIFY(script.open(QIODevice::ReadOnly)); |
| 182 | |
| 183 | scriptText = script.readAll(); |
| 184 | |
| 185 | QVERIFY(scriptText.contains("Begin Custom Script")); |
| 186 | QVERIFY(scriptText.contains("echo 'this is test script'")); |
| 187 | QVERIFY(scriptText.contains("End Custom Script")); |
| 188 | |
| 189 | script.close(); |
| 190 | |
| 191 | |
| 192 | |
| 193 | |
| 194 | } |
| 195 | |
| 196 | void TestBase::runTestParams(QStringList list, |
| 197 | QSet<QString> *tree, |
nothing calls this directly
no test coverage detected