summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* test/run: Use perl module Text::ParseWordsJean Delvare2014-02-121-2/+3
| | | | | | | | Perl has a standard module which can split shell command lines for us, so use it. Function shellwords can deal with quoted parameters too so we no longer need to pass commands to /bin/sh just because they contain quoted parameters. This lowers the ratio of commands passed to /bin/sh from 34% to 31%.
* test/run: Delay command line splittingJean Delvare2014-02-121-11/+11
| | | | | Delay command line splitting until it's actually needed. This avoids having to join it again to log it or to pass it to /bin/sh.
* Style cleanupsJean Delvare2014-02-102-4/+4
|
* Tree-wide white-space cleanupsJean Delvare2014-01-2020-61/+61
| | | | | | | * Delete blank lines at end of files. * Delete white space at end of lines. * Delete spaces before tab. * Replace 8 spaces by a tab where it makes sense.
* Exit with an error when diff's retcode=2 (error) on patch refreshMartin Quinson2014-01-191-0/+38
| | | | | | This is trigered e.g. when you try to add a binary file to a patch. This is actually creepy to think that we were not checking the retcode of diff :)
* empty-files.test: Coding style updateJean Delvare2014-01-181-10/+20
| | | | | | Use the same syntax for file testing as used in other test cases. It is more readable and avoids having to add yet another condition for $needs_shell.
* Test quilt refresh on a patch leaving an empty fileJean Delvare2014-01-171-0/+36
| | | | | | | Add a test case for "quilt refresh" on a patch leaving an empty file. We were already testing that imported patches doing that were handled properly, now we want to ensure that refreshing such patches preserves the information.
* test/refresh_patch_order.test: enforces the file order within a patchMartin Quinson2014-01-171-0/+62
|
* Add a test case for patches leaving empty filesJean Delvare2014-01-171-0/+85
| | | | | | For now this only covers the push and fold commands on imported patches, which we just fixed. Later we can add tests for the refresh command, which is still not OK.
* test/run: Documentation updateJean Delvare2013-12-201-4/+10
| | | | | * Remove the implemented features from the to-do list. * Document the command line interface.
* test/run: Fix variable substitutionJean Delvare2013-12-202-5/+36
| | | | | | | | | | | | | | | | Variable substitution on command lines was happening too early so setting a variable only took effect with the second next line of the test case. Additionally, there was no check that the environment variable was actually set. This resulted in perl warnings during the test suite if a variable is ever used before having been set. Fix both issues. Also add a test case for this feature, to avoid a future breakage. Some of the tester script features are tricky and easy to get wrong, so test them independently of quilt in a dedicated test case.
* test/run: Rewrite the main parsing loopJean Delvare2013-12-201-32/+33
| | | | | | | Rewrite the main parsing loop of the tester scripts, in a way which is easier to understand and avoids redundant tests. No functional change here.
* test: Check more return statusJean Delvare2013-12-171-0/+6
| | | | | Quilt pop at the bottom of the stack returns 2, as does quilt push at the top of the stack.
* test: Record the status returned by every commandJean Delvare2013-12-175-16/+69
| | | | | | | - test/run: Record the status returned by every command, so that test cases can check them. - test/*.text: Test the status returned by all commands in 4 test cases.
* test: ignore leading whitespace in wc output.Kent R. Spillner2013-12-141-16/+16
| | | | | | | | | | | | POSIX-compliant implementations of wc right-justify each column of output in 7 character wide columns. Tests that verify the output of wc -l should take into account the number of digits in the line count and add the appropriate padding. Therefore, in order for the tests to pass with both POSIX-compliant and non-POSIX-compliant implementations of wc tests should match wc output against patterns with optional whitespace prefixes. Signed-off-by: Kent R. Spillner <kspillner@acm.org>
* add a test case where we CC someone w/o a nameMartin Quinson2013-12-081-7/+16
|
* delete.test: Cope with new quoting style in find error messageJean Delvare2013-09-301-1/+1
|
* Document unexpected success as rootJean Delvare2013-05-301-0/+2
|
* failpop.test: Drop needless sleepJean Delvare2013-05-241-2/+0
| | | | | | Timestamp comparisons when popping a patch were fixed in commit 005922085f0135c35baa4b0e8db6f05d78586377, so we can get rid of this sleep in the test suite.
* patches: Add support for multiple filesJean Delvare2013-05-231-0/+9
| | | | | Add support for multiple files to "quilt patches". Patches will be printed, that modify any of the listed files.
* patches: Match deleted files in unapplied patchesJean Delvare2013-05-231-0/+14
| | | | | Let "quilt patches" also match deleted files in unapplied patches. Commit 4df47975 was supposed to fix that already, but did not really.
* Fix syntax highlighting of this file in gedit.Jean Delvare2013-04-301-1/+1
|
* Add a test case for remove-trailing-ws scriptJean Delvare2012-12-181-0/+193
| | | | | | As a bug was recently found in this script, add a test case covering both unified and context patch formats, so that hopefully no other bug creeps in in the future.
* refresh: Accept refreshing empty patchesJean Delvare2012-12-131-0/+22
| | | | | | | If told to refresh a patch and the patch is empty, still obey. The user should know what he/she is doing. If the patch was non-empty before, we must erase it, otherwise a subsequent pop will fail, complaining that the patch should be refreshed.
* Fix handling of patch files with ':' in their nameBenjamin Poirier2012-12-051-0/+47
| | | | | | | | | | | | avoids errors like this: $ quilt refresh sed: -e expression #1, char 21: unknown option to `s' Nothing in patch patches/strange:name [Satoru Takeuchi: suggested first alternative implementation not relying on find -printf.] [Jean Delvare: added missing quoting and a new test file for this case.]
* setup: Check for existing directories before unpackingJean Delvare2012-10-251-1/+6
| | | | Check for existing directories before unpacking.
* setup: Run create_dbJean Delvare2012-10-251-0/+26
| | | | | Run create_db() as part of quilt setup, so that $QUILT_PATCHES and $QUILT_SERIES are recorded for future quilt commands.
* setup.test: Increase test coverageJean Delvare2012-02-171-3/+44
|
* grep: Accept file names with spacesJean Delvare2012-02-011-0/+7
| | | | | | | | | | This is a continuation of Yasushi SHOJI's initial work of fixing support for file names with spaces. This time I fixed support in the grep command. This is particularly important because the grep command operates on all files in the work tree, even if they aren't touched by any patch, so the chances that one of them has a space in its name is greater. As before, no guarantee is made that all options are covered, but this should be a good starting point.
* backup-files: Drop support for backup removalJean Delvare2012-02-011-2/+2
| | | | | | | Drop support for backup removal (option -x). Quilt doesn't use it. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* backup-files: New function for copyJean Delvare2012-02-011-0/+29
| | | | | | | | | | | | | | | | We are abusing backup-files's "backup" function for quilt snapshot. What we need is semantically different, and it works almost by accident. We don't want linked copies of the files, we want real copies, and the fact that "quilt snapshot" may touch the working files is a little frightening IMHO. So, implement a separate "copy" function which does what we need. Not only it does the right thing, but it will also be somewhat faster than "backup", as we can do straight copies of the files without checking for their link count first. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* backup-files: Batch mass restoreJean Delvare2012-02-011-1/+1
| | | | | | | | | | | | | When restoring all files, batch the first steps (directory creation and target file removal) and last steps (optional touch and backup file removal). This makes the typical restore case (quilt pop) much, much faster. Note: a similar optimization would be possible for the removal function (-x), but quilt doesn't use this function at the moment. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* backup-files: Simplify find loopJean Delvare2012-02-011-1/+1
| | | | | | | Let find report errors by itself. Signed-off-by: Jean Delvare <jdelvare@suse.de> Reviewed-by: Raphael Hertzog <hertzog@debian.org>
* Make backup-files a shell scriptMartin Quinson2012-02-011-23/+23
| | | | | | | | Make backup-files a shell script instead of a binary, so we can make quilt arch: all [Steve Langasek, thanks so much] (Closes: Debian #363659) Signed-off-by: Jean Delvare <jdelvare@suse.de>
* Add a dedicated test case for backup-filesJean Delvare2012-02-011-0/+202
| | | | Signed-off-by: Jean Delvare <jdelvare@suse.de>
* import: Fix import of patches from a subdirectory (bug #35244)Jean Delvare2012-01-311-0/+9
|
* test suite: in the "ls -l" output, ignore additional characters after the ↵Andreas Gruenbacher2012-01-231-5/+5
| | | | | | | file permissions Access control lists will add a "+", and SELinux will add a "."; we don't care in the test suite.
* New test case for patches attempting to modify files which do not exist.Jean Delvare2011-04-041-0/+23
|
* configure.ac: Fix test for GNU patch versionJean Delvare2011-03-252-10/+10
| | | | | | | | | | | | | We currently ask for GNU patch >= 2.4, but the test suite doesn't actually pass with GNU patch 2.4. It passes with GNU patch 2.5 with minor edits to be more tolerant to the exact output of "patch". I have no idea how much work it would be to get 2.4 to be supported again, but it doesn't seem unreasonable to ask for 2.5 which was released in August 1997. So let's just do that for now. If anyone badly misses support for GNU patch 2.4, well, we accept patches ;) Signed-off-by: Jean Delvare <jdelvare@suse.de>
* diff, refresh: Accept file names with spacesJean Delvare2011-03-251-0/+52
| | | | | | | | | | This is a continuation of Yasushi SHOJI's initial work of fixing support for file names with spaces. This time I fixed support in the diff and refresh commands, two commands which are frequently used. As before, no guarantee is made that all options are covered, but this should be a good starting point. Signed-off-by: Jean Delvare <jdelvare@suse.de>
* test/run: Enforce single variable substitution methodJean Delvare2011-03-182-3/+2
| | | | | There is no need to have two ways to access environment variables from test cases, one is enough.
* Let the test suite cover "quilt grep".Jean Delvare2011-03-073-0/+10
|
* test/nolink.test: Add missing check, to make sure we won't miss a bug.Jean Delvare2011-01-281-0/+3
|
* Give more meaningful error messagesDavid Paleino2010-01-272-10/+10
| | | | | | | | Differentiate output when $QUILT_PATCHES/series is not found from when $QUILT_PATCHES/series is empty. This has originally been reported as http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=557621
* Let the test suite be run in parallelJean Delvare2010-01-231-8/+50
| | | | | | | | | | | Add an option to the test case runner script to generate an output suitable for parallel runs: * Print the full output at the end of the test case, all at once. * Only output the detailed commands on failed test cases. This makes it possible and convenient to run the test suite in parallel on SMP systems.
* Separate working directory for each test caseJean Delvare2010-01-2345-398/+212
| | | | | | | | | | | | | | | | | Let the test suite runner script create a separate working directory for each test. This makes it possible to run several tests in parallel, speeding up testing on SMP systems. It also ensures that a broken test case can no longer cause another test case to fail. At this point, it is possible to run the test suite in parallel, the final result (success or failure) will be correct, however the output is hardly readable because the progress of all tests are interlaced. This will be improved later. As a nice side effect, this means we can drop the setup and clean-up steps that were present in all test cases.
* Add non-regression test to verify that quilt remembers ↵Raphaël Hertzog2010-01-231-0/+30
| | | | QUILT_PATCHES/QUILT_SERIES
* add, files, remove: accept file name with spacesYasushi SHOJI2009-11-271-0/+43
| | | | | | | | | | | | | http://savannah.nongnu.org/bugs/?19477 and http://lists.nongnu.org/archive/html/quilt-dev/2009-09/msg00010.html reported that the current quilt does not work with file name with spaces. we all know that it is tough to handle it with bash script and fix all quilt commands. this patch only fixes add, files, and remove command with normal code path. no excessive test has been done but a few test code is also added. hope this starts fixing quilt to handle all possible path pattern.
* "quilt revert" accidentally creates a hard link, it shouldn't do that.Jean Delvare2009-06-171-0/+20
| | | | | | | | | | | | | | | | | | | | | | I think the reason is that apply_patch_temporarily() uses backup-files to create the temporary files, and by default backup-files uses hard links. For files which are modified by the patch, this isn't a problem because patch will unlink the file before modifying it. But for files which are not modified by the patch, the hard link is preserved. Then quilt revert also makes a hard link to restore the file, on the assumption that the temporary copy will be deleted right away. At this point, files not modified by the patch will have a link count of 3 (.pc/<patch>/<file>, d.*/<file> and <file>). When the temporary file is deleted, the link count is still 2 (.pc/<patch>/<file> and <file>). A simple way to fix this is to always use cp instead of ln when restoring the files. Performance is not as good, but at least it is always correct. We could optimize the code to use ln when possible and cp for the other cases, but honestly I don't think it is worth the extra complexity. The speed of "quilt revert" is hardly critical, given how infrequently this command is used.
* Minor test suite updateAndreas Gruenbacher2009-06-152-3/+5
| | | | | Recognize the output of more recent versions of patch, and set the coreutils quoting style instead of matching different quoting styles.