summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools
Commit message (Collapse)AuthorAgeFilesLines
* Proper macro replacment and branch evaluationLars Knoll2012-11-232-3/+38
| | | | | | | | | | | | Correclty replace macros according to the C++ standard. Use the correct replacement method also to evaluate With this moc correctly processes boost headers. Task-number: QTBUG-27546 Change-Id: I001b3054c5fcdc34d46cfa53d1387bd19436f361 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* uic - fix to handle QTreeWidget with empty header(s)Thorbjørn Lund Martsum2012-11-212-0/+159
| | | | | | | | | | | | | | | | | | | This makes it possible for uic to handle QTreeWidget that in the designer has one or more empty headers. Before the right(most) empty items where there wasn't a non-empty header to the right of them would not be visible. The other empty items - where there was a header to the right of it would not be empty but initialized with a number. This patch ensures the same behavior that the QTableWidget is having. Task-number: QTBUG-18156 Change-Id: I19bfd3307befe46a1af2d6a3275f7446a15b3442 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix qmake's pro file cache to interact correctly with write_fileSimon Hausmann2012-10-252-0/+26
| | | | | | | | | When writing a file with write_file() we have to inform the pro file parser cache to discard the file if it's existant in the cache, to ensure that calling include() after write_file() always works. Change-Id: I7d09269a57de55ca30b0e11dd40770de9f919f64 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* moc: parse properly the gcc extension for variadic macroOlivier Goffart2012-10-142-0/+18
| | | | | | | Task-number: QTBUG-27547 Change-Id: I983b96b09c405e5330327092e56164b9921a2d0f Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Fix moc preprocessor-only mode with input that contains seemingly invalid ↵Simon Hausmann2012-10-132-0/+63
| | | | | | | | | | | | | | | | | | | | | identifiers In WebKit we use moc -E to pre-process various files before throwing at further build creation tools. The pre-processing is used to filter out code depending in #ifdef'fed features. The latest addition to the family of pre-processed files is the CSS grammar, which is written in Bison. It contains rule lines like $$ = parser->createFoo() and when pre-processing this moc stumbles over the dollar sign. Instead of ignoring un-tokenizable input we should add it to the current token if we're in preprocessor-only mode, otherwise the $$ gets eaten and we produce data-loss by printing out less characters than. Change-Id: Ib32e7c04b38dd2ba3726201e76f27405f7ea6c0d Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Use jom in tst_qmake.Friedemann Kleint2012-10-081-1/+7
| | | | | | | | | | Speed up compiling the tests. Task-number: 26023 Change-Id: Ib5e872cc6cde09ac90f426a8f6e7cfea509d02e2 Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Increase tst_qmake more time on Windows.Friedemann Kleint2012-10-081-0/+2
| | | | | | | | The test compiles examples, which takes a long time. Task-number: 26023 Change-Id: If794b046aa07737f3076aace8d585dc44027cc6b Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Fix moc stumbling over gcc __attribute__ extensionsSimon Hausmann2012-10-012-1/+59
| | | | | | | | | | | | | | | | | Reported by David Faure. In KDE a DEPRECATED macro gets defined in a header file created by cmake. The define is not guarded with #if Q_CC_GNU or similar because at cmake time the compiler is determined. Therefore moc suddenly sees this gcc specific token and stumbles over it. This patch simply defines an empty __attribute__ macro that will expand to nothing and thus become invisible to moc's "C++ parser" after the pre-processing. Change-Id: I4448b9ac3f72b6334e32b27484401fb0fca23a0c Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Test case for moc handling definesLars Knoll2012-09-253-0/+161
| | | | | | | | | Added some test cases that check that moc correctly expands #defines Change-Id: I7fe6eed129d46ca9281d73064571cae43b32410d Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-22154-3750/+3750
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* port qmake to qt creator's qmake language evaluatorOswald Buddenhagen2012-09-111-1/+1
| | | | | | | | | | | | | | | | | | | | | this is a monster commit which does the following things: - import the evaluator as-is from qt creator into qmake/library/ - integrate it into qmake's makefiles - overwrite proitems.h with actual special types - remove the parts of Option which are redundant with QMakeGlobals - make QMakeProperty a singleton owned by Option::globals. the dynamic handling so far made no sense. - make QMakeProject a subclass of QMakeEvaluator, with relatively few extensions the changes to existing qmake code outside project.* and option.* are minor. implementing the changes gradually would mean changing a lot of code which will be just replaced in the next commit, so i'm not wasting my time on it. Change-Id: I9746650423b8c5b3fbd8c3979a73228982a46195 Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* test: Remove QSKIP from tst_uic::stdOut()Sergio Ahumada2012-09-101-3/+0
| | | | | | | | | | This test actually passes on Windows, so removing the QSKIP Task-number: QTBUG-26730 Change-Id: Ife1b5bd0ffa20c433070a1875dde8b6a226c331a Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com> Reviewed-by: J-P Nurmi <j-p.nurmi@nokia.com>
* Fix semantics of the src dir in the include search paths with MinGWSimon Hausmann2012-09-105-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue originates from https://bugs.webkit.org/show_bug.cgi?id=95736 Suppose we have main.cpp somedirectory/someheader.h -- which has #include "anotherheader.h" anotherheader.h With unix generator, the directory where main.cpp is located is included, unless no_include_pwd is set. Hence the look-up of anotherheader.h from within someheader.h will work. With MSVC this works because MSVC looks "in the directories of any previously opened include files in the reverse order in which they were opened." (from http://msdn.microsoft.com/en-us/library/36k2cdd4.aspx) Unfortunately the build breaks with MinGW, because it lacks support for including the source directory in the include search path just like the unix generator does. This patch adds the same functionality to the MinGW generator as well as an auto-test. Change-Id: Iea8bb06e34862c51b8fd4eca2ee26668e24a319a Reviewed-by: Qt Doc Bot <qt_docbot@qt-project.org> Reviewed-by: Sergio Ahumada <sergio.ahumada@nokia.com> Reviewed-by: Jonathan Liu <net147@gmail.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Auto test for 'qmake -project' use case.Rafael Roquetto2012-09-047-4/+205
| | | | | Change-Id: Ifb6d64828ba1cb42fd64299438b7eec302112edf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Generate includes for Qt containers used as auto-metatypes.Stephen Kelly2012-09-032-0/+77
| | | | | | | | | | | | Otherwise the containers might be forward declared in the moc file, and when the moc file is compiled in a standalone translation unit, the full definition of it would not be available. This results in odd compile errors, so instead generate the includes if required. Change-Id: Ie01c5a5d45314daad0b00dec03b3e1e18cdbae64 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Volker Krause <volker.krause@kdab.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Fix moc generating invalid code for slots with reference types as argument.Volker Krause2012-09-021-0/+6
| | | | | | | | | | | We can't have T& declared/registered as a metatype (wont compile), but using it as type for a slot argument is possible. With the recent introduction of metatype auto-registration we have to make sure that moc doesn't attempt to auto-register those. Simple types are handled correctly already, this fixes containers and smart pointers. Change-Id: Id96857c57d6ebf158a67e9d527c89dc195473b1b Reviewed-by: Stephen Kelly <stephen.kelly@kdab.com>
* Add automatic metatype registration for invokable methods.Stephen Kelly2012-08-281-0/+234
| | | | | | | | | | | This works similarly to the automatic registration for Q_PROPERTY types, but in this case it mostly affects the need for users to call qRegisterMetaType<T>() before using queued connections with methods using non-built-in metatypes, or before using invokeMethod manually. Change-Id: Ib17d0606b77b0130624b6a88b57c36d26e97d12d Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Add automatic metatype registration for Q_PROPERTY types.Stephen Kelly2012-08-281-0/+172
| | | | | | | | | | | | | | | | In Qt 4, the user needs to call qRegisterMetaType if the property could otherwise be read before the type is registered with the metatype system. This patch makes that unnecessary and automatic by registering it when the first read indicates that it is not yet registered instead or when QMetaProperty::userType is called before it is registered. The types which are automatically registered exclude the built-in types, which do not need to be registered, and include metatypes which are automatically declared, such as pointers to QObject derived types and containers of existing metatypes. Change-Id: I0a06d8efdcb64121618e2378366d0142fa0771f5 Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* moc: test slots marked final/override in various waysMarc Mutz2012-08-263-0/+297
| | | | | | | | | While writing the test, I found that moc doesn't yet support volatile slots. I left the tests in, commented, for a time when it does. Change-Id: Ib5fa00b25600618aedcc66739630054f3c879b99 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* moc: parse classes that use Q_DECL_FINAL|final|sealedMarc Mutz2012-08-263-3/+167
| | | | | | | | | | | | | | | | | | | | This only works with the C++11 contextual keyword directly, the MSVC equivalent 'sealed', or the Qt define for it. While this isn't a problem for syncqt, being an internal tool, moc should eventually be able to parse user code using local C++11-final-wrapping macros. For this, I guess moc would have to be taught to expand macros in code and not just test #if clauses, potentially driven by something like #pragma qt-moc expand-this #define MY_FINAL_CLASS final but that's something for someone more intimately familiar with moc's source than I am. Change-Id: Id6aec961a881e8d5a9b76a7fc8e1c02c71913f64 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Remove relic QT_VERSION from qmake testRafael Roquetto2012-08-141-1/+1
| | | | | Change-Id: Ic9095e3e924543d4f3e6d0f7c3a7b27f842cd300 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* uic-Autotest: Remove SRCDIR-define, add stdout-test.Friedemann Kleint2012-08-023-74/+86
| | | | | | | | | | | | | | - Replace SRCDIR define by QFINDTESTDATA, simplify code. - Introduce a test for stdout mode that verifies the newline convention. - Use a temporary directory as not to clobber the test directory and introduce an environment variable UIC_KEEP_GENERATED_FILES to keep them for error analysis. Task-number: QTBUG-26730 Change-Id: I22e3bb5a9ca92a1977c29b165ea605f1017baa02 Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-0134-1/+35
| | | | | | | | | | | Qt 5.0 beta requires changing the default to the 5.0 API, disabling the deprecated code. However, tests should test (and often do) the compatibility API too, so turn it back on. Task-number: QTBUG-25053 Change-Id: I8129c3ef3cb58541c95a32d083850d9e7f768927 Reviewed-by: Lars Knoll <lars.knoll@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* fix host vs. makefile directory separator messOswald Buddenhagen2012-07-281-4/+12
| | | | | | | | | | | | | | | | | the system path separator and shell are bound to the host system (system() will use cmd even on mingw with sh.exe in path). the makefiles otoh may depend on what the qmakespec defines. consequently, add $$system_path() and $$system_quote() (for use with system() & $$system()). $$native_path() is renamed to $$shell_path() and should be used with $$shell_quote() to produce command lines in makefiles. $$QMAKE_DIR_SEP needs to be applied to Option::dir_sep right after parsing the spec, so it is available to $$shell_{path,quote}(). Change-Id: If3db4849e7f96068cf03a32348a24f3a72d6292c Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com> Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* Add some tests to note that private signals can't be overloads.Stephen Kelly2012-07-131-0/+88
| | | | | | | | | This is just for completeness of the understanding of the limitations of private signals. There are no private signals in Qt which have overloads. Change-Id: Ic34c555aea360ee34beec796e597657888573da9 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Create a way to inform moc about private signals.Stephen Kelly2012-07-131-0/+370
| | | | | | | | | | | | | | | | | | Moc checks for the use of the QPrivateSignal struct, which is part of the Q_OBJECT macro and is private to each class that uses it. Moc then generates a name of the signal which does not include the private struct, and generates code to invoke such signals with an instance of the private struct. This way we can mark private signals as such and prevent them from being emitted from subclasses or from outside of the class entirely. The drawback to this is that it only works if the private signal has no default arguments. However, at least in Qt, there are no such signals. Change-Id: Id16eadaa8d3c36a2c3b265077877f3e1d8304c84 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* test behavior of $${absolute,relative}_path() with empty 1st argumentOswald Buddenhagen2012-07-121-0/+2
| | | | | Change-Id: I76c0853a9d397979f2ae5eb780374d2380c989f1 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* Update the moc no-keywords test for the signals replacement.Stephen Kelly2012-07-091-1/+1
| | | | | Change-Id: I5c544e71615b00ff8fd337579fcd185e4b8e24af Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Uppercase the CONFIG for verbatim mode.Stephen Kelly2012-07-041-1/+1
| | | | | Change-Id: Iec883e0218af80fc329d866affb2b95db72c54d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Revert "Allow moc to handle symbols that have been redefined."Matthew Vogt2012-07-041-152/+0
| | | | | | | | | | | | This reverts commit 5bb1408927b4eb5a03e8ab9f7cbc68f80d8a3962. The temporary measure used to support redefinition of QtDeclarative class names during the transition period is no longer required. Task-number: QTBUG-24517 Change-Id: Ib90f08fcdfb02e004e594ac72b698eaa0325d98d Reviewed-by: Kent Hansen <kent.hansen@nokia.com> Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* do not unnecessarily mess with CONFIGOswald Buddenhagen2012-06-273-26/+26
| | | | | | | it could/would bite us later Change-Id: I73f989e7603c6e5b7b85fc4ee4ad2557c1b02d80 Reviewed-by: Mark Brand <mabrand@mabrand.nl>
* fix somewhat common edge case in $$shadowed()Oswald Buddenhagen2012-06-261-0/+1
| | | | | | | | | | | | if source and build dir are direct children of the common root and we are shadowing the top-level source dir, there is of course no trailing slash to match. Change-Id: I8a34a6a72d16cb21d77d056e037235af9b32a008 Reviewed-by: Davide Pesavento <davidepesa@gmail.com> Reviewed-by: Andreas Hartmetz <ahartmetz@gmail.com> Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Change *-clang mkspec globs to *-clang*Bradley T. Hughes2012-06-201-1/+1
| | | | | | | | Like with the numerous g++ mkspecs, we have mkspecs with suffixes, and these mkspecs should still match the clang globs. Change-Id: I9296408b5192bc72cc468d229a57923e3f5ab6f0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix unused parameter warnings in moc test.Mitch Curtis2012-06-201-3/+3
| | | | | Change-Id: I3467a8bf99464c2d3762a171b20508bb4b29ddb4 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@nokia.com>
* add $$reverse() functionOswald Buddenhagen2012-06-191-0/+2
| | | | | | | | | returns the list with the order of the elements reversed. one can easily implement this with existing functions, but this is way faster and more readable. Change-Id: I12d306eb9fe58fc332622274ea6b658192529491 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* add $$shell_quote() functionOswald Buddenhagen2012-06-191-0/+8
| | | | | | | | to be used in system() calls and when assembling EXTRA_COMPILER and INSTALLS .commands by hand. Change-Id: Id706cd56aa267a9fb4b14e3416692b4716fafa5b Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$absolute_path() and $$relative_path()Oswald Buddenhagen2012-06-191-0/+5
| | | | | | | just exposes QDir::fooFilePath() wrapped into QDir::cleanPath() Change-Id: I7a7644084825fd8092a9910ac20f695c4d9351f6 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$native_path() functionOswald Buddenhagen2012-06-191-0/+2
| | | | | | | more or less QDir::toNativeSeparators(QDir::cleanPath()) Change-Id: I52deee1e8086559eda5833b387a0cf64d21cbcd9 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$clean_path() functionOswald Buddenhagen2012-06-191-0/+2
| | | | | | | just QDir::cleanPath() Change-Id: I2d51e2385939d8926c00f296537ab7f6757d9a79 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$format_number() functionOswald Buddenhagen2012-06-191-0/+14
| | | | | Change-Id: I04266c1f5fb72af94073f3f508cee59085e365b6 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$shadowed() functionOswald Buddenhagen2012-06-192-1/+3
| | | | | | | | | return the build directory corresponding to a given source directory. this is the identity function if not shadow-building. if input lies outside the source directory, return empty value. Change-Id: I2d2a6b1112bd19989fe29cfe19a12d39a0d208c1 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add $$val_escape() functionOswald Buddenhagen2012-06-191-0/+9
| | | | | | | | this quotes the elements of a variable in a way suitable for re-parsing as qmake code. Change-Id: I0e6ea2478c43b5aeff45f485a48ac8c86705dd4a Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add mkpath() functionOswald Buddenhagen2012-06-191-0/+4
| | | | | Change-Id: I8809b9ee4e85fbe8cec95641d659f237c5f51a26 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* add write_file() functionOswald Buddenhagen2012-06-191-1/+15
| | | | | | | | | this dumps the contents of a variable into a file. each element of the variable is considered a line; line terminators are added. all missing directories are automatically created. Change-Id: Idafeb873cea64e6705c894b3ab0ef21df69e7170 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Replace QTEST_APPLESS_MAIN with QTEST_MAIN in tests using QProcessRohan McGovern2012-06-053-3/+3
| | | | | | | | | | QProcess requires an application object to be created in order to work correctly on Windows. Task-number: QTBUG-26023 Task-number: QTBUG-26024 Change-Id: Ifa90946262bc7e2a7df6b6aad54e10b54473fc97 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Marked tst_qmake as parallel-safeRohan McGovern2012-05-291-0/+1
| | | | | | | | | This autotest fails a parallel-stress test because it writes into its own source/build directory. However, by inspection, it appears not likely to cause issues with any tests other than itself. Change-Id: I13789ba14bab240d34c22c5b77d6407995423afc Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Add CONFIG+=parallel_test to suspected parallel-safe tests.Rohan McGovern2012-05-281-0/+1
| | | | | | | | | These tests have passed a parallel stress test on all three of Linux, Mac, Windows. Mark them with CONFIG+=parallel_test to allow CI to run them in parallel, saving time. Change-Id: I19fd333c3c645a67374ca998f6c8530dd236b0f8 Reviewed-by: Toby Tomkins <toby.tomkins@nokia.com>
* Don't use the deprecated translate() method anymoreLars Knoll2012-05-1899-981/+981
| | | | | | | | | | The Encoding argument of QCoreApplication::translate() is deprecated and source code is always assumed to be encoded in Utf8. Simply remove the encoding argument from the generated .ui.h files. Change-Id: If6c40f6df13abd45a0303c863077972c3d1fb685 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [QtDBus]Thiago Macieira2012-05-071-1/+1
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: I052a3412a568ad639f2bf169b4491b56dddff1c7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Change remaining uses of {to,from}Ascii to {to,from}Latin1 [other]Thiago Macieira2012-05-042-3/+3
| | | | | | | | | | This operation should be a no-op anyway, since at this point in time, the fromAscii and toAscii functions simply call their fromLatin1 and toLatin1 counterparts. Task-number: QTBUG-21872 Change-Id: Ib1eaf42679ab5db4005192c3d00ba79e43edfcca Reviewed-by: Lars Knoll <lars.knoll@nokia.com>