summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* diff: Report diff failuresJean Delvare2016-10-191-0/+1
| | | | | "quilt refresh" reports diff failures to the user. "quilt diff" should do the same.
* Project settings have priorityJean Delvare2015-12-041-0/+22
| | | | | | | | If QUILT_PATCHES or QUILT_SERIES are set both in ~/.quiltrc and .pc/.quilt_patches (respectively .pc/.quilt_series), the former currently takes precedence. This pretty much voids the value of per-project settings. Project settings should have the highest priority.
* Let cat_to_new_file handle the file backupJean Delvare2015-03-191-0/+37
| | | | | | | | | | | | | Let function cat_to_new_file optionally backup the destination file before overwriting it. This has two advantages: * This avoids duplicating code on the caller's side. Functions header and refresh both need to perform a backup. * This guarantees the consistency of the backup logic. At the moment, the refresh command would handle the backup of a symlinked file just fine while the header command would misbehave in that case. Now that the header command handles symlinked patches properly, also test it so that we don't break it accidentally later.
* hard-linked-patch.test: Test the header commandJean Delvare2015-03-191-0/+24
| | | | | Extend the hard-linked patch test case to also check the behavior when updating the header of such a patch.
* Test backup failureJean Delvare2015-03-191-0/+23
| | | | Add a test case for backup failure to the test suite.
* symlink.test: Make the test more robustJean Delvare2015-02-251-0/+1
| | | | | | | "mv" may or may not overwrite a read-only file by default, depending on whether or not it is considered to be interactive. Removing the file explicitly before avoids that uncertainty and makes it easier to play the test case manually.
* refresh: Always preserve modification timeJean Delvare2015-02-251-0/+3
| | | | | | In the general case, when doing a backup copy of a patch on refresh, the modification time of the file is preserved. We should do the same when the patch is a symbolic link.
* refresh: Break links to read-only patch filesJean Delvare2015-02-251-0/+48
| | | | | | | | We just changed the behavior of the refresh command to no longer break symbolic links. While preserving the links is the right thing to do in the general case, this approach fails if the patch file is read-only. In that case we want to replace the link itself with the refreshed patch, as we used to.
* refresh: Do not remove symlinksJason Wessel2015-02-181-0/+53
| | | | | | | | | | | | | | | | | | | | | | Change the core behavior of quilt to not remove symlinks to the patch files. Historical notes: This is an 6 year old patch that is still actively used for the Yocto Project and others. http://lists.nongnu.org/archive/html/quilt-dev/2008-01/msg00004.html Revised again here: http://comments.gmane.org/gmane.comp.handhelds.openembedded/34224 [Edited by Jean Delvare: removed a compatibility option, we'll introduce it only if users ask for it. Also cleaned up the test case a bit.] Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
* edit: Fix a corner caseJean Delvare2015-02-181-1/+32
| | | | | | | | | | | | | | | | There is one corner case which is not properly handled by the "edit" command. If a patch deletes a file, and the user calls "quilt edit" on that file but does not actually add anything back to it, "quilt remove" is called on the file when the editor exits. This causes the file to be restored to its original state before the patch deleted it. The user never asked for that, so the file should be left to its deleted state in this case. The file must only be removed from the patch if it was not part of the patch originally. The same problem would occur if the editor deleted the file. In general text editors don't do that, they'd leave an empty file instead, but nothing prevents them from actually deleting the file so we should handle this case properly too.
* edit: Use command "remove" to remove filesJean Delvare2015-02-181-0/+11
| | | | | | | | | | | Commit f1c186ee renamed command "remove" to "revert". Commit bd1dfdab changed the semantics of command "revert". Commit 6d2501ac restored command "remove". However command "edit" is still calling command "revert" to remove files from the patch when it should be using command "remove". This case was not covered by the test suite, which is why the bug was not spotted earlier.
* edit: Improve the test caseJean Delvare2015-02-181-3/+24
| | | | | | | | | Cover one more use case of the "edit" command in the test case: file creation. Also reorder some of the commands to make the tests easier to follow. The intent is easier to understand when the result is tested after each command.
* Merge the two revert test casesJean Delvare2015-02-172-46/+26
| | | | | Merge the two revert test cases into a single, complete and commented test file.
* test/mail: Test multi-line headersJean Delvare2015-01-271-2/+6
| | | | Add coverage of the multi-line header case to the mail test case.
* Test refresh behavior on hard-linked patchesJean Delvare2015-01-141-0/+36
| | | | | | If a patch file has hard links, refreshing it should break the links so that the other copies are left unmodified. Test this behavior to avoid breaking it accidentally.
* push: Add --refresh optionJean Delvare2014-11-121-0/+25
| | | | | Add an option to automatically refresh each patch after is was successfully applied.
* pop: Add --refresh optionJean Delvare2014-11-121-0/+30
| | | | | Add an option to automatically refresh each patch before it gets unapplied.
* pop: Rearm consistency check if neededJean Delvare2014-10-301-6/+17
| | | | | | | | If the series file is inconsistent, "quilt pop" will disable the consistency check as it updates the timestamp of the database file. It's OK if all patches are popped. If not then the series file may still be inconsistent. In that case, we want to update the timestamp of the series file, to rearm the consistency check.
* push: Fix handling of "quilt push 0"Jean Delvare2014-10-291-0/+10
| | | | | | | | | "quilt push 0" returns the following cryptic message: Now at patch patches/quilt So add the same check we already have in command pop and detect when nothing needs to be done, returning the more sane message: No patch applied
* Check for series file consistencyJean Delvare2014-10-271-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quilt allows manual changes to the series file to some degree. For example, adding comments or reordering patches in the unapplied section of the series file is OK. However, changing the order of applied patches breaks a number of assumptions and can cause quilt to produce unexpected or confusing results. For example, starting from this: + patches/01.patch = patches/02.patch patches/03.patch patches/04.patch and moving the last patch at the beginning of the series file, "quilt series -v" will print: + patches/04.patch + patches/01.patch = patches/02.patch patches/03.patch That is, it will claim that 04.patch is applied, while it it not. Likewise, 04.patch would be listed by neither "quilt applied" nor "quilt unapplied". While addressing all such cases would certainly be possible, that would require a significant amount of work, and would come with performance penalties. It would also be difficult to be certain that all issues have been found and addressed. So it seems more reasonable to simply spot such manual changes to the series file and ask the user to pop all patches to start from a clean state as needed.
* Test push and pop with numeric argumentsJean Delvare2014-10-151-0/+23
|
* files: Add support for unapplied patchesJean Delvare2014-07-231-0/+3
| | | | | | We already have a function to figure out which files are touched by unapplied patches. The only thing missing to let the user call "quilt files" on unapplied patches was two small spots of glue.
* Test context patchesJean Delvare2014-07-141-1/+43
| | | | | Now that the patches command works with context patches, we can test that.
* setup: Skip version checkJean Delvare2014-06-091-0/+7
| | | | | | | The version check is irrelevant when running "quilt setup", as it is creating a brand new working tree anyway. Reported by Petr Tesarik.
* faildiff.test: loosen error string constraintKent R. Spillner2014-06-031-1/+1
| | | | | | | | diff might be called by a different name if the configure script was invoked with the --with-diff argument. Make the permissions test in faildiff.test match other names as well. Signed-off-by: Kent R. Spillner <kspillner@acm.org>
* test: Extend mail.test to check for more than 2 duplicate subject linesJean Delvare2014-04-251-0/+11
|
* test: Make patch-wrapper.test saferJean Delvare2014-04-251-0/+7
| | | | | Create directory "patches" so that quilt commands get the right root even if patch-wrapper fails.
* patches: Fix heuristic for unapplied patches with timestampsJean Delvare2014-04-091-0/+46
| | | | | | | | | | The heuristic to find file names in unapplied patches fails miserably on all patches with timestamps. We have to consider everything past the last tab as the timestamp and strip it. The timestamp itself will contain spaces so we can't split on that. This fixes a regression introduced by commit 4df47975. It's hard to believe this has been broken for over 4 years and nobody ever noticed.
* diff: Workaround bash bugJean Delvare2014-03-042-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | Old versions of bash (at least version 3.2.51) don't properly handle prefix stripping together with quoting when evaluating an array. So strip the prefix before adding each file to opt_files. It's faster anyway. Same thing when diffing against a snapshot, strip the snapshot directory prefix from file names before evaluating the quoted files array. This fixes a regression introduced in: commit b0baeeb6b61132af92fd75df5f912554d295dee1 Author: Jean Delvare <jdelvare@suse.de> Date: Fri Mar 25 18:48:49 2011 +0100 diff, refresh: Accept file names with spaces (Only affecting the versions of bash which have the aforementioned bug.) This also fixes a bug when called from a subdirectory and a file passed as an argument starts with "./". Extend the test suite to test both cases, so that such bugs can't sneak in in the future.
* test: Improve the coverage of unusual patch namesJean Delvare2014-03-021-0/+36
| | | | | Test the top and previous of patches with unusual names. Also test a few more unusual characters.
* push: Check for duplicate patch in seriesJean Delvare2014-03-021-0/+37
| | | | | | | | | | In the case of a generated or manually tweaked series file, it can happen that the same patch shows up twice in the series file. Check for this before pushing any patch, otherwise we would corrupt quilt's internal database. This fixes bug #20628: https://savannah.nongnu.org/bugs/?20628
* test: Drop legacy comment in two test casesJean Delvare2014-02-282-4/+0
| | | | These instructions no longer works.
* test: Drop stray slashesJean Delvare2014-02-282-2/+2
| | | | %{P} already has a trailing slash.
* test/setup: Fix for GNU patch version <= 2.5.9Jean Delvare2014-02-261-3/+5
| | | | | | Recent versions of GNU diff will quote file names which include a space, but GNU patch version 2.5.9 and older do not support that. So strip the quotes to let the test succeed.
* test: Improve the coverage of the patches commandJean Delvare2014-02-242-0/+30
| | | | | | | Add tests for the patches command in two test cases. In particular we want to test that the patches command works OK when patch filenames contain spaces or other unusual characters, and that file names are properly guessed in patches which create or delete files.
* files: Return nothing if there are no filesJean Delvare2014-02-141-0/+1
| | | | | | | "quilt files" returns a blank line if no files are included in the patch. This could easily break constructs such as "quilt files | wc -l". Let "quilt files" return nothing at all if there are no files in the patch.
* test/run: Minor performance optimizationsJean Delvare2014-02-121-7/+6
| | | | | | | | * Don't set $needs_shell before we need it. When handling commands internally, we don't care about $needs_shell. * Use a single regexp to set $use_re. * Clear $good as soon as a test fails, instead of grepping for failures later.
* test/run: Fix the condition for using /bin/shJean Delvare2014-02-121-1/+1
| | | | | * Command lines containing "&" need /bin/sh. * "*" and "?" need not be escaped inside brackets in regular expressions.
* test/run: Declare global variables as suchJean Delvare2014-02-121-6/+6
| | | | | Declare all global variables with qw() and stop passing them as arguments to some functions.
* test/run: Reorder functionsJean Delvare2014-02-121-132/+125
| | | | | Move functions before they are called, so that we no longer need forward declarations.
* test/run: Massive reindentationJean Delvare2014-02-121-155/+152
| | | | | Code indentation in this file is inconsistent, this makes editing it difficult. Use tabulations everywhere.
* test/run: Drop support for su and sgJean Delvare2014-02-121-77/+1
| | | | | | The su and sg commands can only work if running as root. The quilt test cases do not use these commands and I certainly wouldn't recommend running the test suite as root, so drop the feature.
* 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
|