aboutsummaryrefslogtreecommitdiff
path: root/share/examples/tests
Commit message (Collapse)AuthorAgeFilesLines
* Remove residual blank line at start of MakefileWarner Losh2024-07-155-5/+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
* Silence snprintf truncation warnings in printf_test examplesDimitry Andric2023-12-213-0/+12
| | | | | | | | | | | | | | Building share/examples/tests with clang 18 results in a few warnings like: share/examples/tests/tests/plain/printf_test.c:67:6: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 17 [-Werror,-Wformat-truncation] 67 | if (snprintf(buffer, sizeof(buffer), "0123456789abcdef") != 16) | ^ Since these tests are meant as an example of testing snprintf overflow, suppress the warnings. MFC after: 3 days
* share/examples/tests: fix comments after $FreeBSD$ removalEd Maste2023-08-162-2/+2
| | | | Fixes: 2a63c3be1582 ("Remove $FreeBSD$: one-line .c comment pattern")
* Remove $FreeBSD$: one-line lua tagWarner Losh2023-08-163-3/+0
| | | | Remove /^--\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line bare tagWarner Losh2023-08-161-1/+0
| | | | Remove /^\s*\$FreeBSD\$$\n/
* Remove $FreeBSD$: one-line sh patternWarner Losh2023-08-1614-14/+0
| | | | Remove /^\s*#[#!]?\s*\$FreeBSD\$.*$\n/
* Remove $FreeBSD$: one-line .c comment patternWarner Losh2023-08-163-3/+0
| | | | Remove /^/[*/]\s*\$FreeBSD\$.*\n/
* Update the spelling of my nameEnji Cooper2019-04-221-2/+1
| | | | | | | | | | | | Previous spellings of my name (NGie, Ngie) weren't my legal spelling. Use Enji instead for clarity. While here, remove "All Rights Reserved" from copyrights I "own". MFC after: 1 week Notes: svn path=/head/; revision=346571
* Initial googlemock/googletest integration into the build/FreeBSD test suiteEnji Cooper2019-03-152-0/+65
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This initial integration takes googlemock/googletest release 1.8.1, integrates the library, tests, and sample unit tests into the build. googlemock/googletest's inclusion is optionally available via `MK_GOOGLETEST`. `MK_GOOGLETEST` is dependent on `MK_TESTS` and is enabled by default when built with a C++11 capable toolchain. Google tests can be specified via the `GTESTS` variable, which, in comparison with the other test drivers, is more simplified/streamlined, as Googletest only supports C++ tests; not raw C or shell tests (C tests can be written in C++ using the standard embedding methods). No dependent libraries are assumed for the tests. One must specify `gmock`, `gmock_main`, `gtest`, or `gtest_main`, via `LIBADD` for the program. More information about googlemock and googletest can be found on the Googletest [project page](https://github.com/google/googletest), and the [GoogleMock](https://github.com/google/googletest/blob/v1.8.x/googlemock/docs/Documentation.md) and [GoogleTest](https://github.com/google/googletest/tree/v1.8.x/googletest/docs) docs. These tests are originally integrated into the build as plain driver tests, but will be natively integrated into Kyua in a later version. Known issues/Errata: * [WhenDynamicCastToTest.AmbiguousCast fails on FreeBSD](https://github.com/google/googletest/issues/2172) Reviewed by: asomers Approved by: emaste (mentor) MFC after: 2 months Differential Revision: https://reviews.freebsd.org/D19551 Notes: svn path=/head/; revision=345203
| * Compile and install most of the googletest examplesEnji Cooper2019-03-112-0/+42
|/ | | | | | | | sample9_unittest is not compiled/installed, because it intentionally fails and would result in red test runs until broken to always pass. Notes: svn path=/projects/import-googletest-1.8.1/; revision=345023
* General further adoption of SPDX licensing ID tags.Pedro F. Giffuni2017-11-203-1/+8
| | | | | | | | | | | | | | | | | Mainly focus on files that use BSD 3-Clause license. The Software Package Data Exchange (SPDX) group provides a specification to make it easier for automated tools to detect and summarize well known opensource licenses. We are gradually adopting the specification, noting that the tags are considered only advisory and do not, in any way, superceed or replace the license texts. Special thanks to Wind River for providing access to "The Duke of Highlander" tool: an older (2014) run over FreeBSD tree was useful as a starting point. Notes: svn path=/head/; revision=326025
* DIRDEPS_BUILD: Update dependencies.Bryan Drewery2017-10-313-3/+0
| | | | | | | Sponsored by: Dell EMC Isilon Notes: svn path=/head/; revision=325188
* Add kyua TAP test integration examplesEnji Cooper2017-06-286-0/+399
| | | | | | | | | | The examples are patterned loosely after the ATF examples, similar to the plain test examples. MFC after: 1 month Notes: svn path=/head/; revision=320443
* share/examples/tests/{atf,plain}/Makefile: tweak example Makefile snippetsEnji Cooper2017-06-282-8/+4
| | | | | | | | | | | | - Including bsd.own.mk isn't required since no MK_<foo> knobs are being manipulated. - Update documentation to note that ${FILES} is installed via bsd.progs.mk, not bsd.prog.mk. MFC after: 1 month Notes: svn path=/head/; revision=320442
* share/examples/tests/Makefile: clean up example snippets/documentationEnji Cooper2017-06-281-4/+6
| | | | | | | | | | | | | - TESTSDIR doesn't need to be specified after r289158. - Including bsd.own.mk isn't required since no MK_<foo> knobs are being manipulated. - TESTS_SUBDIRS should be written out in an append format, one entry per line, to provide a better, more conflict resistant example. MFC after: 1 month Notes: svn path=/head/; revision=320441
* Merge ^/user/ngie/release-pkg-fix-tests to unbreak how test files are installedEnji Cooper2016-05-046-29/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix including Kyuafile in packaged base system.Glen Barber2016-04-294-4/+8
| | | | | | | | | | | | | | | Fix a related typo while here. Note, this change results in the Kyuafile inclusion in the runtime package, which needs to be fixed, however addresses the PR as far as I can tell in my tests. PR: 209114 Submitted by: ngie Sponsored by: The FreeBSD Foundation Notes: svn path=/head/; revision=298768
* MFHGlen Barber2016-03-104-0/+59
|\ | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=296625
| * DIRDEPS_BUILD: Connect MK_TESTS.Bryan Drewery2016-03-094-0/+59
| | | | | | | | | | | | | | Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=296587
* | More 'tests' packaging fixes.Glen Barber2016-02-031-0/+5
| | | | | | | | | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295216
* | First pass to fix the 'tests' packages.Glen Barber2016-02-023-0/+14
|/ | | | | | | Sponsored by: The FreeBSD Foundation Notes: svn path=/projects/release-pkg/; revision=295171
* Add missing return statement to atf/printf_test to make the exampleEnji Cooper2015-12-201-0/+2
| | | | | | | | | | | complete and correct, and mute a compiler warning from clang MFC after: 3 days Reported by: Jenkins Sponsored by: EMC / Isilon Storage Division Notes: svn path=/head/; revision=292485
* Refactor the test/ Makefiles after recent changes to bsd.test.mk (r289158) andEnji Cooper2015-10-121-3/+1
| | | | | | | | | | | | | | | 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
* Add missing shebangJulio Merino2015-07-041-0/+1
| | | | | | | | | | | | | | Plain test programs are not preprocessed by the build system (as opposed to ATF test cases, which automatically gain a shebang pointing at atf-sh), so we must take care of providing the shebang ourselves. I'm not sure why this was not causing problems with Kyua 0.11, but the upcoming 0.12 release chokes on this particular issue. MFC after: 1 week Notes: svn path=/head/; revision=285118
* Remove unnecessary svn:executable property from source file.Julio Merino2014-03-141-0/+0
| | | | | | | | | The atf cp_test.sh sample file should have never been marked executable in the first place because this file needs to be "built" first before being usable. Notes: svn path=/head/; revision=263173
* Make bsd.test.mk the only public mk fragment for the building of tests.Julio Merino2014-03-142-2/+2
| | | | | | | | | | | | | | | | | Change {atf,plain,tap}.test.mk to be internal implementation details of bsd.test.mk. Makefiles that build tests should now only include bsd.test.mk and declaratively specify what they want to build, without worrying about the internal implementation of the mk files. The reason for this change is to permit building test programs of different interfaces from a single directory, which is something I had a need for while porting tests over from src/tools/regression/. Additionally, this change makes it possible to perform some other requested changes to bsd.test.mk in an easier manner. Coming soon. Notes: svn path=/head/; revision=263161
* Generate plain sh test programs from a source file.Julio Merino2013-11-251-0/+0
| | | | | | | | | | | | | | | | | Instead of assuming that plain sh test programs exist in the source tree in their final form and are marked as executable, generate them from a list of sources. By default, just assume that the source file for a program P is P.sh but allow the caller to customize the inputs. Similarly, also allow the caller to apply sed(1) replacements on the output. These will both be useful in hooking existing test code from tools/regression/ into the test suite. Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=258552
* Add some sample test programs.Julio Merino2013-11-1811-0/+706
This change adds some sample test cases to share/examples/tests/ demonstrating the basic usage of the atf and plain interfaces. These test programs are fully-functional and are installed as part of the test suite, which guarantees that the sample code remains correct. However, they currently mostly serve as a placeholder for additional examples and may be incomplete (depending on how you look at them). I will see what else can be useful while working on documentation. As a bonus, the addition of these tests exercise the *.test.mk files, one of which (plain.test.mk) was not yet in use, and also demonstrates that it's possible to mix different kinds of test programs into the same test suite. Approved by: rpaulo (mentor) Notes: svn path=/head/; revision=258299