tests/auto/compilerwarnings/tst_compilerwarnings.cpp
changeset 7 f7bc934e204c
parent 0 1918ee327afb
child 29 b72c6db6890b
equal deleted inserted replaced
3:41300fa6a67c 7:f7bc934e204c
     1 /****************************************************************************
     1 /****************************************************************************
     2 **
     2 **
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
     3 ** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
     4 ** All rights reserved.
     4 ** All rights reserved.
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
     6 **
     6 **
     7 ** This file is part of the test suite of the Qt Toolkit.
     7 ** This file is part of the test suite of the Qt Toolkit.
     8 **
     8 **
   146     QString templatePath = QDir::temp().absoluteFilePath(tmpBaseName);
   146     QString templatePath = QDir::temp().absoluteFilePath(tmpBaseName);
   147     QFile tmpQSourceFile(templatePath);
   147     QFile tmpQSourceFile(templatePath);
   148     if (tmpSourceFile.isEmpty()) {
   148     if (tmpSourceFile.isEmpty()) {
   149         tmpQSourceFile.open(QIODevice::ReadWrite | QIODevice::Truncate);
   149         tmpQSourceFile.open(QIODevice::ReadWrite | QIODevice::Truncate);
   150         tmpSourceFile = tmpQSourceFile.fileName();
   150         tmpSourceFile = tmpQSourceFile.fileName();
   151         QFile cppSource(":/test.cpp");
   151         QFile cppSource(":/test_cpp.txt");
   152         bool openResult = cppSource.open(QIODevice::ReadOnly);
   152         bool openResult = cppSource.open(QIODevice::ReadOnly);
   153         if (openResult)
   153         if (openResult)
   154         {
   154         {
   155             QTextStream in(&cppSource);
   155             QTextStream in(&cppSource);
   156             QTextStream out(&tmpQSourceFile);
   156             QTextStream out(&tmpQSourceFile);
   157             out << in.readAll();
   157             out << in.readAll();
   158         }
   158         }
   159     }
   159     }
   160     tmpQSourceFile.close();
   160     tmpQSourceFile.close();
   161     QVERIFY2(openResult, "Need resource temporary \"test.cpp\"");
   161     QVERIFY2(openResult, "Need resource temporary \"test_cpp.txt\"");
   162 
   162 
   163     QStringList args;
   163     QStringList args;
   164     QString compilerName;
   164     QString compilerName;
   165 
   165 
   166     static QString qtDir = QString::fromLocal8Bit(qgetenv("QTDIR"));
   166     static QString qtDir = QString::fromLocal8Bit(qgetenv("QTDIR"));