aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/cmp/tests
Commit message (Collapse)AuthorAgeFilesLines
* Improve reliability of stdout tests.Dag-Erling Smørgrav2024-11-141-0/+1
| | | | | | | | | | | If the test runner is under heavy load, the command we are testing may succeed in printing to stdout before the dummy receiver has terminated. Add a short delay to reduce the likelihood of this happening. MFC after: 1 week Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47572
* cmp: Check the status of stdout.Dag-Erling Smørgrav2024-10-091-0/+30
| | | | | | | | | | POSIX requires us to print an error message and exit non-zero if writing to stdout fails. This can only happen if sflag is unset. MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D47020
* cmp: Style and type issues.Dag-Erling Smørgrav2024-10-091-8/+8
| | | | | | | MFC after: 3 days Sponsored by: Klara, Inc. Reviewed by: 0mp, markj Differential Revision: https://reviews.freebsd.org/D47019
* Remove residual blank line at start of MakefileWarner Losh2024-07-151-1/+0
| | | | | | | This is a residual of the $FreeBSD$ removal. MFC After: 3 days (though I'll just run the command on the branches) Sponsored by: Netflix
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-163-3/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* spdx: The BSD-2-Clause-FreeBSD identifier is obsolete, drop -FreeBSDWarner Losh2023-05-121-1/+1
| | | | | | | | | The SPDX folks have obsoleted the BSD-2-Clause-FreeBSD identifier. Catch up to that fact and revert to their recommended match of BSD-2-Clause. Discussed with: pfg MFC After: 3 days Sponsored by: Netflix
* cmp: add -b, --print-bytesKyle Evans2021-09-294-0/+24
| | | | | | | | This is compatible with GNU cmp. Reviewed by: bapt, markj (earlier version) Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32074
* cmp: add -i, --ignore-initial, an alternative to skip1/skip2 argsKyle Evans2021-09-291-0/+5
| | | | | | | | This is compatible with GNU cmp. Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32073
* cmp: add -n, --bytes to limit number of bytes to compareKyle Evans2021-09-291-0/+23
| | | | | | | | This is compatible with GNU cmp. Reviewed by: markj Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32072
* cmp: accept SI suffixes for skip1 and skip2Kyle Evans2021-09-291-0/+17
| | | | | | | | This is compatible with GNU cmp. Reviewed by: bapt (earlier version), markj, imp Sponsored by: Klara, Inc. Differential Revision: https://reviews.freebsd.org/D32071
* cmp: fix -s (silent) when used with skip offsetsEd Maste2021-01-111-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | -s causes cmp to print nothing for differing files, for use when only the exit status is of interest. -z compares the file size first, for regular files, and fails the comparison early if they do not match. Prior to this change -s implied -z as an optimization, but this is not valid when file offsets are specified. Now, enable the -z optimization for -s only if both skip arguments are not provided / 0. Note that using -z with differing skip values will currently always fail. We may want to compare size1 - skip1 with size2 - skip2 instaead, and in any case the man page should be clarified. PR: 252542 Fixes: 3e6902efc802ab57fc4e9bf798f2d271b152e7f9 Reported by: William Ahern Reviewed by: markj MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D28071
* Drop "All rights reserved" from the files I ownAlan Somers2019-03-111-1/+2
| | | | | | | | | Also, add SPDX tags where needed. MFC after: 2 weeks Notes: svn path=/head/; revision=345034
* Fix handling of rights on stdio streams, take two.Mark Johnston2019-02-251-0/+2
| | | | | | | | | | | | | | | | | | | Split the rights-limiting code into two cases: if one of the input files isn't a regular file, use caph_limit_stream(3) instead of open-coding the same logic; if both input files are regular files, and the initial attempts to map them succeed, we limit the rights on those files to CAP_MMAP_R. Add a regression test for PR 234885. PR: 234885 Reviewed by: delphij MFC after: 2 weeks Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D19216 Notes: svn path=/head/; revision=344551
* Fix cmp(1) tests for "special" mode.Mark Johnston2019-01-211-5/+4
| | | | | | | | | | | Test failures don't seem to propagate up if atf_check is run in a pipeline. Thus, the tests continued to pass despite the bug reverted in r343245. MFC after: 1 week Notes: svn path=/head/; revision=343247
* Fix file descriptor leaks in cmp(1)Alan Somers2017-01-072-0/+68
| | | | | | | | | | | | | | Also, add a few test cases Reported by: Coverity CID: 271624 275338 Reviewed by: ngie MFC after: 4 weeks Sponsored by: Spectra Logic Corp Differential Revision: https://reviews.freebsd.org/D9074 Notes: svn path=/head/; revision=311572
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-041-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | after r298107 Summary of changes: - Replace all instances of FILES/TESTS with ${PACKAGE}FILES. This ensures that namespacing is kept with FILES appropriately, and that this shouldn't need to be repeated if the namespace changes -- only the definition of PACKAGE needs to be changed - Allow PACKAGE to be overridden by callers instead of forcing it to always be `tests`. In the event we get to the point where things can be split up enough in the base system, it would make more sense to group the tests with the blocks they're a part of, e.g. byacc with byacc-tests, etc - Remove PACKAGE definitions where possible, i.e. where FILES wasn't used previously. - Remove unnecessary TESTSPACKAGE definitions; this has been elided into bsd.tests.mk - Remove unnecessary BINDIRs used previously with ${PACKAGE}FILES; ${PACKAGE}FILESDIR is now automatically defined in bsd.test.mk. - Fix installation of files under data/ subdirectories in lib/libc/tests/hash and lib/libc/tests/net/getaddrinfo - Remove unnecessary .include <bsd.own.mk>s (some opportunistic cleanup) Document the proposed changes in share/examples/tests/tests/... via examples so it's clear that ${PACKAGES}FILES is the suggested way forward in terms of replacing FILES. share/mk/bsd.README didn't seem like the appropriate method of communicating that info. MFC after: never probably X-MFC with: r298107 PR: 209114 Relnotes: yes Tested with: buildworld, installworld, checkworld; buildworld, packageworld Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=299094
* MFHGlen Barber2016-03-101-0/+11
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-091-0/+11
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | First pass to fix the 'tests' packages.Glen Barber2016-02-021-0/+4
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andEnji Cooper2015-10-121-6/+3
| | | | | | | | | | | | | | | netbsd-tests.test.mk (r289151) - Eliminate explicit OBJTOP/SRCTOP setting - Convert all ad hoc NetBSD test integration over to netbsd-tests.test.mk - Remove unnecessary TESTSDIR setting - Use SRCTOP where possible for clarity MFC after: 2 weeks Sponsored by: EMC / Isilon Storage Divison Notes: svn path=/head/; revision=289172
* Integrate usr.bin/cmp/tests from NetBSD into atf/kyuaEnji Cooper2014-10-091-0/+12
In collaboration with: sjg Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=272780