summaryrefslogtreecommitdiffstats
path: root/test/util/pacsorttest.sh
AgeCommit message (Collapse)AuthorFilesLines
2014-11-20pacsort: parse inputs up front into control structDave Reisner1-1/+10
This moves most of the parsing work out of the sorting path. The explode and splitfile functions now call input_new and append input_t structs to the list of sort candidates instead of raw strings. This lets us make smarter and easier decisions in the sorting callbacks, which are now also split into the version and file comparison methods for clarity. This fixes two bugs: 1) Incorrect ordering with filenames containing epoch in the pkgver 2) Incorrect ordering with package names which are substrings of each other (e.g. "systemd" and "systemd-sysvcompat"). Performance of the --files mode degrades slightly as a result of this change, but not unreasonably. Sorting with small inputs (5-10) doubles in runtime, but larger inputs (4000+) only increase by 20%. ref: https://bugs.archlinux.org/task/37631 Signed-off-by: Allan McRae <allan@archlinux.org>
2014-01-06Update copyright years for 2014Allan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2013-11-15Makefile.am: fix typo in LOG_DRIVER variableAndrew Gregory1-2/+2
Self-executing tests were not being run through the tap log driver. This caused `make check` to ignore discrepancies between the expected number of tests and the actual number of tests. Also, fix some uncommented output from test scripts that could confuse TAP parsers. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21provide default values for test scriptsAndrew Gregory1-9/+6
Our test scripts currently require that the first argument be the library or binary to be tested. This makes integrating them with automake which doesn't have a mechanism for passing specific arguments to individual tests. Instead, provide a default built from paths in the environment which can be provided to all test scripts by automake. Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-08-21convert test scripts to tap outputAndrew Gregory1-11/+17
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2013-01-28pacsort: add -f, --files option for sorting filenamesDave Reisner1-0/+18
Teach pacsort to understand package filenames and optionally strip away some of the context. alpm_pkg_vercmp() intentionally only understands pure versions, so strings such as '18.0-2-x86_64' and '18.0.1-1-x86_64' will be compared wrongly. Partially addresses FS#33455. Signed-off-by: Dave Reisner <dreisner@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2011-10-07Format pacsort and vercmp testsuite outputAllan McRae1-2/+4
Make the output into a single block and add separators at the end so that they do not merge into each other. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2011-08-08Add a test harness for new pacsort commandDan McGee1-0/+103
Note that this is meant to exercise pacsort more than the underlying version comparsion; that is better left to the standalone vercmptest.sh test script. Signed-off-by: Dan McGee <dan@archlinux.org>