diff options
| author | Joerg Bornemann <joerg.bornemann@digia.com> | 2013-09-02 10:44:53 +0200 |
|---|---|---|
| committer | Christian Kandeler <christian.kandeler@digia.com> | 2013-09-02 17:28:59 +0200 |
| commit | 9da9f9f91241deba28c0fc6b3d818b7f88848915 (patch) | |
| tree | eb121a2c55de7861724cac38027b28a4ba8e838a /tests/auto | |
| parent | bb3f5f7580481947e4131f0b6493683e3f2e9cb1 (diff) | |
| download | qbs-9da9f9f91241deba28c0fc6b3d818b7f88848915.tar.gz | |
add autotest for precompiled headers
Change-Id: Idf4a34615541a2ec187745d6195ecdbd34f51a8e
Reviewed-by: Christian Kandeler <christian.kandeler@digia.com>
Diffstat (limited to 'tests/auto')
6 files changed, 78 insertions, 0 deletions
diff --git a/tests/auto/blackbox/testdata/precompiledHeader/main.cpp b/tests/auto/blackbox/testdata/precompiledHeader/main.cpp new file mode 100644 index 000000000..400762bc6 --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiledHeader/main.cpp @@ -0,0 +1,27 @@ +#include "myobject.h" +#include <algorithm> +#include <iostream> +#include <list> + +using namespace std; + +int main() +{ + MyObject obj; + list<int> lst; + lst.push_back(1); + lst.push_back(2); + lst.push_back(3); + lst.push_back(4); + lst.push_back(5); + lst.push_back(6); + lst.push_back(7); + lst.push_back(8); + lst.push_back(9); + reverse(lst.begin(), lst.end()); + for (list<int>::iterator it=lst.begin(); it != lst.end(); ++it) + cout << *it << ", "; + cout << endl; + return 0; +} + diff --git a/tests/auto/blackbox/testdata/precompiledHeader/myobject.cpp b/tests/auto/blackbox/testdata/precompiledHeader/myobject.cpp new file mode 100644 index 000000000..9f3f93740 --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiledHeader/myobject.cpp @@ -0,0 +1,13 @@ +#include <iostream> +#include "myobject.h" + +MyObject::MyObject() +{ + std::cout << "MyObject::MyObject()\n"; +} + +MyObject::~MyObject() +{ + std::cout << "MyObject::~MyObject()" << std::endl; +} + diff --git a/tests/auto/blackbox/testdata/precompiledHeader/myobject.h b/tests/auto/blackbox/testdata/precompiledHeader/myobject.h new file mode 100644 index 000000000..17dfd48c8 --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiledHeader/myobject.h @@ -0,0 +1,12 @@ +#ifndef MYOBJECT_H +#define MYOBJECT_H + +class MyObject +{ +public: + MyObject(); + ~MyObject(); +}; + +#endif + diff --git a/tests/auto/blackbox/testdata/precompiledHeader/precompiledHeader.qbs b/tests/auto/blackbox/testdata/precompiledHeader/precompiledHeader.qbs new file mode 100644 index 000000000..8252dc649 --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiledHeader/precompiledHeader.qbs @@ -0,0 +1,13 @@ +import qbs 1.0 + +Product { + type: "application" + name: "MyApp" + files: ["stable.h", + "myobject.h", + "main.cpp", + "myobject.cpp"] + Depends { name: "cpp" } + cpp.precompiledHeader: "stable.h" +} + diff --git a/tests/auto/blackbox/testdata/precompiledHeader/stable.h b/tests/auto/blackbox/testdata/precompiledHeader/stable.h new file mode 100644 index 000000000..93ce3cb29 --- /dev/null +++ b/tests/auto/blackbox/testdata/precompiledHeader/stable.h @@ -0,0 +1,9 @@ +/* Add C includes here */ + +#if defined __cplusplus +/* Add C++ includes here */ + +# include <iostream> +# include <algorithm> +#endif + diff --git a/tests/auto/blackbox/tst_blackbox.cpp b/tests/auto/blackbox/tst_blackbox.cpp index 8e012b1da..2ccf23270 100644 --- a/tests/auto/blackbox/tst_blackbox.cpp +++ b/tests/auto/blackbox/tst_blackbox.cpp @@ -188,6 +188,10 @@ void TestBlackbox::build_project_data() << QString("link_staticlib") << QString(buildDir + QLatin1String("/") + HostOsInfo::appendExecutableSuffix("HelloWorld")); + QTest::newRow("precompiled header") + << QString("precompiledHeader") + << QString(buildDir + QLatin1String("/") + + HostOsInfo::appendExecutableSuffix("MyApp")); QTest::newRow("lots of dots") << QString("lotsofdots") << QString(buildDir + QLatin1String("/") |
