summaryrefslogtreecommitdiff
path: root/test/libapt/parsedepends_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Deal better with spurious spaces in arch restrictionsDavid Kalnischkies2024-05-161-0/+52
| | | | | | | | Another instance of our parser written for sane clean input, but nowadays used also for user-provided input which can contain very many strange formatting and especially white spaces all over the place. Closes: #1071219
* build: test: Silence warnings in GTest codeJulian Andres Klode2024-04-201-1/+1
| | | | | GTest has a lot of broken things with signed vs unsigned, and double integer promotions, let's silence them.
* Allow no spaces for the last dependency in ParseDepends, tooDavid Kalnischkies2024-04-171-0/+33
| | | | | | | | | | | | | | | | | | | | All other entries in a dependency line get substantial leeway about the amount of spaces surrounding the entry itself and its individual parts, but the very last entry was required to have a version constraint be at least 4 chars long (excluding opening bracket and spaces following it), so if the version is short and a single-char relation used a space had to make up for it. This is a bit unfair in comparison to the other entries who do not have such unreasonable demands, so we reduce our demand to 3 chars or longer, which is satisfied by "=1)". If it is a good idea to hate spaces that much remains unanswered by this commit, but in practice most tools (re)writing the files we parse will include spaces, so its only in files (or on the satisfy command line) directly edited by users that we can encounter such a situation, which is a relatively new development given this line came unchanged from the introduction of this method in 1998. LP: #2061834
* Modernize standard library includesJulian Andres Klode2024-02-201-1/+1
| | | | | | This was automated with sed and git-clang-format, and then I had to fix up the top of policy.cc by hand as git-clang-format accidentally indented it by two spaces.
* Reformat and sort all includes with clang-formatJulian Andres Klode2017-07-121-2/+2
| | | | | | | | | | | | | This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
* Run parsedepends_test for two different native archsJulian Andres Klode2017-01-021-40/+43
| | | | | | | Run the test for kfreebsd-i386 and amd64 and pass "amd64" as an additional argument to the function. This tests that the argument is used and thus ParseDepends returns the amd64 results even on a different architecture like i386.
* support <libc>-<kernel>-<cpu> in architecture specsDavid Kalnischkies2016-01-311-0/+22
| | | | | | | | | | | | | | | | | | | APT has a different understanding than dpkg (#748936) what matches and what doesn't match an architecture specification as it isn't converting back (and forward) to Debian triplets. That has to eventually be solved some way or the other, but until that happens we change the matching in apt so that porters can continue their work on non-gnu libc-ports even if policy doesn't specify that yet (and dpkg just supporting it "by accident" via triplets). The initial patch was reformatted, fixed in terms of patterns containing "any-any", dealing with expanding an arch without libc to gnu while a pattern expands libc to any, the parsedepends test was fixed (the new if's were inserted one step too early) and another test just for the specifications added. Closes: #812212 Thanks: Bálint Réczey for initial patch
* implement the updated build profile specjosch2014-10-061-9/+20
|
* build: Convert from DebianDoc SGML to DocBook XMLGuillem Jover2014-07-081-2/+2
|
* use Google C++ Testing Framework for libapt testsDavid Kalnischkies2014-04-161-225/+233
| | | | | | | | | | | | My commit 45df0ad2 from 26. Nov 2009 had a little remark: "The commit also includes a very very simple testapp." This was never intended to be permanent, but as usually… The commit adds the needed make magic to compile gtest statically as it is required and links it against a small runner. All previous testcase binaries are reimplemented in gtest and combined in this runner. While most code is a 1:1 translation some had to be rewritten like compareversion_test.cc, but the coverage remains the same.
* cleanup headers and especially #includes everywhereDavid Kalnischkies2014-03-131-0/+6
| | | | | | | | Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
* warning: unused parameter ‘foo’ [-Wunused-parameter]David Kalnischkies2014-03-131-1/+1
| | | | | Reported-By: gcc -Wunused-parameter Git-Dch: Ignore
* implement BuildProfileSpec support as dpkg has in 1.17.2Johannes Schauer2014-03-131-27/+61
| | | | | | | | Build-dependencies are now able to include a <profile.foo …> specification limiting usage similar to already supported [arch …]. More details: https://wiki.debian.org/BuildProfileSpec Closes: 661537
* rework some code to fix some scan-build warningsDavid Kalnischkies2014-01-161-1/+1
| | | | | | | | No visible functional changes, just code moved around and additional checks to eliminate impossible branches Reported-By: scan-build Git-Dch: Ignore
* add two tests for architecture specificationsDavid Kalnischkies2012-06-141-5/+5
|
* do not pollute namespace in the headers with using (Closes: #500198)David Kalnischkies2011-09-191-2/+2
|
* extends the ParseDepends testcase to have a look also at the WildcardsDavid Kalnischkies2010-07-051-0/+68
|
* Ignore :qualifiers after package name in build dependenciesDavid Kalnischkies2009-11-291-0/+128
for now as long we don't understand them (Closes: #558103)