summaryrefslogtreecommitdiffstats
path: root/tests/auto/tools/qmake/testdata
Commit message (Collapse)AuthorAgeFilesLines
* Adapt qmake's raw-string parser to avoid confusion by macrosEdward Welbourne2017-08-243-2/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | A macro name ending in R might expand to a string; if this precedes a string constant, we're juxtaposing the strings. My first parser for raw strings would mistake it for a raw string instead, ignoring the part of the identifier before R. Re-worked the exploration of what came before the string to catch these cases, too. The backwards parsing would also allow any messy jumble of [RLUu8]* as prefix for the string; but in fact R must (if present) be last in the prefix and *it* can have at most one prefix, [LUu] or u8. Anything else is an identifier that happens to precede the string. Reworked the parsing to allow only one prefix and not treat R specially unless it's immediately (modulo BSNL) before the string's open-quotes. Add link to the cppreference page about string literals, on which the grammar now parsed is based. Added a test for the issue this addresses. Verified that this fails on 5.6, dev and 5.9 without the fix. Expanded the existing test to cover R-with-prefix cases. Task-number: QTBUG-55633 Change-Id: I541486c2ec909cfb42050907c84bee83ead4a2f4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* make extra compiler targets depend on their respective compilerOswald Buddenhagen2016-04-181-1/+1
| | | | | Change-Id: I6c04e0188137f6bbfeab243f00860b8ff079f69a Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-2152-884/+624
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* qmake: teach findMocs to handle backslash-newline gracefully.Edward Welbourne2015-12-178-11/+103
| | | | | Change-Id: Id71352c0cf71ab84bd81d4f3d11bb19dc7965903 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* qmake: teach moc-detector to handle C++-11 raw stringsEdward Welbourne2015-12-151-2/+1
| | | | | | | | As for the #include-parser, the moc-detector's minimal C preprocessor could be confused by a raw string into ignoring large chunks of code. Change-Id: Id688e9a1f04628ce75a51a7d15269078c734288e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* qmake: Fix comment false-alarm bug in findMocs().Edward Welbourne2015-12-151-0/+1
| | | | | | | | | | If a / wasn't part of a comment-start, it and the character after it were none the less stepped over. If the character after started an enclosure, this would duly be missed, leading to mis-parsing of the subsequent text. As for similar bug recently fixed in findDeps(). Change-Id: Ie5329ec633c23a554b42a6351723c980e27fb9a9 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Rewrote qmake's #include-detection to be more faithful to CPP.Edward Welbourne2015-12-155-11/+126
| | | | | | | | | | | The C preprocessor allows backslash-newline anywhere and allows comments anywhere it allows space. Testing wilfully perverse applications of that revealed qmake's parsing of #include directives wasn't very robust. So rework to actually follow the rules and add those tests. Change-Id: If5cc7bfb65f9994e9ab9ed216dd1ee7285c63934 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Don't ignore first character after a string.Edward Welbourne2015-12-111-0/+3
| | | | | | | | | | | | The parser in QMakeSourceFileInfo::findDeps() would step over the closing quote of a string, only to have a for loop then step over the character just after that closing quote, which was thus never studied; this could lead to problems in various ways. Fixed that and expanded findDeps() test to catch regressions. Task-number: QTBUG-17533 Change-Id: I7dec5222e38fa188495b39376ffee70bc7bbc87f Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Teach qmake's #include parser to recognize C++11 Raw strings.Edward Welbourne2015-12-083-0/+82
| | | | | | | | | | | | | Can't sensibly test unless the compiler does support raw strings, since any test that would catch qmake's (prior) inability to parse raw strings would necessarily confuse the C++ compiler in the same way. This even applies (in test app code) to any #if-ery around the raw string, since tokenization happens before preprocessor directives are resolved. So the #if-ery on Q_COMPILER_RAW_STRINGS has to be in tst_qmake.cpp, not the test app it builds. Change-Id: I4a461f515adff288b54fb273fd9996f9b906d11c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Ignore stuff created during testingEdward Welbourne2015-11-251-0/+5
| | | | | Change-Id: I05c93c9739ff8397606088d0b23e58d145f124a4 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Avoid having division caught up in parsing of comments.Edward Welbourne2015-11-203-3/+9
| | | | | | | | | | | | | | | | | | A loop to skip space and comments was meant to break on anything else but would have not broken on a division operator (where it should) due to it getting caught in the check for a comment-start, without falling back suitably when it didn't complete that check. Managed to contrive a suitably twisted change to findDeps test to reveal the bug; broken previously, now fixed. Not ideal, as it relied on another bug to fail previously - backslash-newline shouldn't end a preprocessing directive line - but it should still pass once that's fixed, too. Exercising a bug in qmake usually involves code that won't compile anyway, making it tricky to write a test that reveals the bug but that passes once it's fixed. Change-Id: I08a1d7cc5e3d7fd1ac0a48e5c09dfdfbb7580b11 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into devSimon Hausmann2015-06-0325-728/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qnamespace.qdoc src/corelib/io/qwindowspipereader.cpp src/corelib/io/qwindowspipereader_p.h src/corelib/statemachine/qstatemachine.cpp src/corelib/statemachine/qstatemachine_p.h src/plugins/platforms/xcb/qxcbconnection.h tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp tests/auto/tools/qmake/tst_qmake.cpp tests/manual/touch/main.cpp Change-Id: I917d694890e79ee3da7d65134b5b085e23e0dd62
| * remove now redundant testsOswald Buddenhagen2015-05-2025-728/+0
| | | | | | | | | | | | | | the functionality is now covered by the qmakelib test. Change-Id: Id627f573fb247ff3b86558509e27b6a9862c1a59 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | Allow RESOURCES to contain standalone files and collections of filesTor Arne Vestbø2015-05-184-0/+57
|/ | | | | | | | | | | Standalone files are added by using RESOURCES += file.txt, while collections of files are defined as collection.files = f1.txt f2.txt and then added using RESOURCES += collection. For collections a prefix can also be set using collection.prefix = /foo. The standalone files are not prefixed. Change-Id: I8236808238414da05e744f799a1bb15a72f4a46f Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* more autotests for spaces, destdirs and library linkingOswald Buddenhagen2015-02-1711-18/+32
| | | | | Change-Id: Ie106d1151e61a50081bccea0a6d0d70728451a5b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-1156-392/+392
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* make shellQuoteWin() be more sparing with circumflexesOswald Buddenhagen2015-02-041-3/+3
| | | | | | | | | | | | ... as newer versions of nmake (and jom, for compatibility) have botched circumflex processing (they simply don't do it when shortcutting the shell evaluation). as a side effect, the output is also more readable if the string contains quotes. Change-Id: I0506b59ceecb70da258c482f9973156b2803066d Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* de-noise testOswald Buddenhagen2015-02-042-0/+4
| | | | | | | | don't complain about various missing things resulting from replacing default_pre.prf and having a private .qmake.cache. Change-Id: Ie3471b514ebb1a80b72a480144551b56b5c7a254 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-2456-1064/+616
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* add priority sorting to $$resolve_depends()Oswald Buddenhagen2014-07-301-0/+9
| | | | | | | | all else being equal, items with a higher numerical priority will appear first in the result. Change-Id: I4ee37ff404a53c4152a1e4fc2fc3c23ef525234d Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Add JSON parsing support to qmake.Morten Johan Sørvig2013-10-172-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add qjson* implementation files from corelib/json to the qmake build. Add a read-only compile mode, enabled by defining QT_JSON_READONLY. Add qmake built-in function parseJson(file, into) which parses a json file into the given variable. qmake uses a flat key -> value-list implementation for storing variables, which means that some hackery is need to represent arbitrarily nested JSON. Use a special "_KEYS_" variable for arrays and objects: Arrays: ["item1", "item2"] $${array._KEYS_} -> 0 1 2 $${array.0} -> "item1" $${array.1} -> "item2" Objects: { "key1" : "value1", "key2" : "value2" } $${object._KEYS_} -> key1 key2 $${object.key1} -> value1 $${object.key2} -> value2 Change-Id: I0aa2e4e4ae14fa25be8242bc16d3cffce32504d2 Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* make split_value_list() even less sane againOswald Buddenhagen2013-07-032-0/+3
| | | | | | | | | | | contrary to what one may expect, it's actually *not* supposed to remove the meta-characters it interprets. luckily, this function is not used much any more ... Task-number: QTBUG-31877 Change-Id: I2b60f9b173140da78db2b07b596cc2e5f6e6d555 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* remove nonsense DEFINESOswald Buddenhagen2013-07-0328-58/+0
| | | | | Change-Id: Ie079c52eb800878983501b9fe2b2f6c27df0cdb1 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-1856-56/+56
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* remove some unnecessary CONFIG additionsOswald Buddenhagen2012-12-177-7/+3
| | | | | | | | qt is already added by spec_pre.prf, warn_on and depend_includepath by default_pre.prf. Change-Id: Ic00e0ba496d698ed9659c476f2ca99fc0f86a093 Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com>
* qmake: Test recursive function callsKonstantin Ritt2012-11-261-0/+14
| | | | | Change-Id: If7d659728d30b2e5c52082ab999bc00de3733972 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Fix qmake's pro file cache to interact correctly with write_fileSimon Hausmann2012-10-251-0/+19
| | | | | | | | | 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>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-2256-1400/+1400
| | | | | | | | 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>
* Fix semantics of the src dir in the include search paths with MinGWSimon Hausmann2012-09-104-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-044-0/+152
| | | | | Change-Id: Ifb6d64828ba1cb42fd64299438b7eec302112edf Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>
* Set the Qt API level to compatibility mode in all tests.Thiago Macieira2012-08-0128-0/+28
| | | | | | | | | | | 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>
* 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>
* Uppercase the CONFIG for verbatim mode.Stephen Kelly2012-07-041-1/+1
| | | | | Change-Id: Iec883e0218af80fc329d866affb2b95db72c54d3 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.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>
* 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-191-0/+1
| | | | | | | | | 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>
* remove strange .qmake.cache hacksOswald Buddenhagen2012-03-085-26/+0
| | | | | | | | they are obsolete (qmake knows the qt build configuration anyway), and messing with QTDIR is a recipe for disaster. Change-Id: Ib3594f38ec3192a5f70771f8bc5d8fd435bbbd15 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* remove injection of default_pre in infile()/$$fromfile()Oswald Buddenhagen2012-03-051-0/+1
| | | | | | | | | | this is a hack from the times when these functions were (ab)used to inspect proper project files, but the inclusion was done with a clean project, so that the included files did not have any functions to work with. Change-Id: I19925e8ead597ca38df040000c183e368b32c06d Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* don't rely on $PATH for finding rccOswald Buddenhagen2012-02-271-1/+3
| | | | | Change-Id: I7e6ffad6d84cca0b548920b3e620375fb5e314e9 Reviewed-by: Joerg Bornemann <joerg.bornemann@nokia.com>
* clean up qmake-generated projectsOswald Buddenhagen2012-02-243-16/+0
| | | | | | | | remove "header" and assignmets which are defaults or bogus, reorder some assignments. Change-Id: I67403872168c890ca3b696753ceb01c605d19be7 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>