summaryrefslogtreecommitdiffstats
path: root/test/lib
Commit message (Collapse)AuthorAgeFilesLines
* test/lib: Avoid array overflow of child_argv[]Anton Blanchard2016-03-231-1/+1
| | | | | | | We allocate 3 elements in child_argv, but write 4. Signed-off-by: Anton Blanchard <anton@samba.org> Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
* tests/lib/test-fold: Add mbs test with separatorsJeremy Kerr2014-09-231-1/+12
| | | | | | | Ensure we're doing the correct thing with mbs + separators in the fold code. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/fold: Add support for multibyte stringsJeremy Kerr2014-09-231-4/+50
| | | | | | | | | | Currently, the fold_text function doesn't understand multibyte strings, so may break a line in the middle of a multibyte sequence. This change adds multibyte-awareness to the fold code, and uses proper width calculations for the contents of the folded string. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* autotools: Use non-recursive makeJeremy Kerr2014-08-011-25/+16
| | | | | | | | | | | | With the current testing infrastructure, we don't have a strictly hierarchical set of dependencies. This causes problems with a recursive make, and means we have to hack around some of the dependencies. This change generates a single, top-level makefile from all of the Makefile.am fragments. We still need the po/ directory as a separate SUBDIR, but all others can be converted to non-recursive. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: Don't abort stdout reads on EINTRJeremy Kerr2014-02-202-0/+58
| | | | | | | | | | | | | | | | | If our read() of the process stdout pipe fails with EINTR (eg, if we receive a SIGCHLD because the process exited), then process_read_stdout_once will return a non-zero exit code, and we'll abort any further stdout collection. Instead, we should check for EINTR, and allow the reads to continue. This change normalises the return value from process_read_stdout_once to return positive on success, negative on failure, and zero on competion. We use a positive return value for the non-error EINTR case. Also, add a pb_log if the read fails for non-EINTR reasons. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/fold: Add text fold utilityJeremy Kerr2014-01-312-1/+159
| | | | | | | We want to fold help text into the ncurses UI, so add a little module to split text into lines. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* lib/process: Add add_stderr flag to process moduleJeremy Kerr2014-01-143-0/+113
| | | | | | | | | | | | For some process execution functions, we'd like to capture stderr as well as stdout. Currently, we unconditionally redirect subprocess stderr to the petitboot log file. This change adds an add_stderr flag to struct process, which indicates to the process library that we want stderr as well as stdout. If this is specified, the subprocess' stderr is captured to stdout_buf. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* configure: Use AC_GNU_SOURCEJeremy Kerr2013-12-181-2/+0
| | | | | | | Rather than #defining _GNU_SOURCE in our .c files, we can define this from config.h instead. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: Add parent stdout testJeremy Kerr2013-12-182-0/+56
| | | | | | Looks like we missed adding a test source file. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: Implement process_init change in testcasesJeremy Kerr2013-08-296-6/+6
| | | | | | We need to provide the dry_run argument. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: add process testsJeremy Kerr2013-08-197-4/+407
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: Use talloc in list testJeremy Kerr2013-08-191-1/+8
| | | | | | .. so we can free at exit Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: build with -DEBUGJeremy Kerr2013-08-191-3/+2
| | | | Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* Makefiles: remove -I$(includedir)Jeremy Kerr2013-05-071-1/+0
| | | | | | | | | | | Currently, we include the system include dir in some of our makefiles; this is causing build problems when cross-compiling, as the system include dir may not contain files for the host. The compiler should be searing in the proper system include dir, so just remove the redundant -I. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test/lib: Add empty list testJeremy Kerr2013-05-031-1/+17
| | | | | | | Check that the list iterators work on empty lists too. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Geoff Levand <geoff@infradead.org>
* test/lib: Hook into `make check`Jeremy Kerr2013-04-292-2/+3
| | | | | | | This change hooks the new list tests into 'make check'. To do this, we need to fix the return code of the list-test program. Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
* test: Rename test/list to test/libGeoff Levand2013-04-282-0/+101
Having a test/list directory is a little too specific, so rename the test/list directory to test/lib as a place for any lib tests. Signed-off-by: Geoff Levand <geoff@infradead.org>
OpenPOWER on IntegriCloud