summaryrefslogtreecommitdiff
path: root/modules/getlogin_r-tests
Commit message (Collapse)AuthorAgeFilesLines
* getlogin, getlogin_r: Rename LIB_GETLOGIN to GETLOGIN_LIB.Bruno Haible2023-01-071-1/+1
| | | | | | * m4/getlogin.m4: Rename LIB_GETLOGIN to GETLOGIN_LIB. All uses changed. * NEWS: Mention the change.
* getlogin, getlogin_r tests: Avoid test failure in specific environments.Bruno Haible2022-06-061-0/+1
| | | | | | | | | | | Reported by Letu Ren <fantasquex@gmail.com> in <https://lists.gnu.org/archive/html/bug-gnulib/2022-06/msg00001.html>. * modules/getlogin-tests (Depends-on): Add stdbool. * modules/getlogin_r-tests (Depends-on): Likewise. * tests/test-getlogin.h: Include stdbool.h. (test_getlogin_result): On Linux, skip the test if /proc/self/loginuid contains "-1".
* getlogin tests: Avoid #ifdefs when sharing code between modules.Bruno Haible2017-07-111-0/+1
| | | | | | | | | | * modules/getlogin_r-tests (Files): Add tests/test-getlogin.h. * modules/getlogin-tests (Files): Likewise. Remove tests/test-getlogin_r.c. * tests/test-getlogin.h: Extracted from tests/test-getlogin_r.c. * tests/test-getlogin.c: Extracted from tests/test-getlogin_r.c. * tests/test-getlogin_r.c: Include test-getlogin.h. Omit code that tests getlogin().
* getlogin: don’t assume one name per uidPaul Eggert2017-07-101-1/+0
| | | | | | | | | | | | | | Problem reported by Wolfgang F. Muthmann (Bug#27640). * modules/getlogin-tests (Files): Add tests/test-getlogin_r.c. (ttyname): Remove test. * modules/getlogin_r-tests (ttyname): Remove test. * tests/test-getlogin.c: Replace this near-clone of test-getlogin_r.c with ‘#define TEST_LOGIN’ followed by ‘#include "test-getlogin_r.c"’. * tests/test-getlogin_r.c: If TEST_GETLOGIN is defined, test getlogin rather than getlogin_r. This avoids code duplication. (main): Use isatty and fstat rather than ttyname and stat. Use getpwnam instead of getpwuid, to be portable to test platforms that have multiple login names for the same uid.
* getlogin, getlogin_r: Fix link errors on MSVC.Bruno Haible2016-12-181-0/+1
| | | | | | | | | | | | * m4/getlogin.m4 (gl_LIB_GETLOGIN): New macro. * modules/getlogin (configure.ac): Require gl_LIB_GETLOGIN. (Link): New section. * modules/getlogin_r (Files): Add m4/getlogin.m4. (configure.ac): Require gl_LIB_GETLOGIN. (Link): New section. * NEWS: Mention the new link requirements. * modules/getlogin-tests (test_getlogin_LDADD): New variable. * modules/getlogin_r-tests (test_getlogin_r_LDADD): New variable.
* getlogin_r-tests: fix various issues in recent changePádraig Brady2014-05-221-0/+1
| | | | | | | | * tests/test-getlogin_r.c: Include required headers that were missed in recent commit eec20b4e. Also consistently check the errno rather than the return value from getlogin_r as POSIX only specifies that non zero is returned on error. * modules/getlogin_r-tests (configure.ac): Add the check for ttyname().
* Tests for module 'getlogin_r'.Bruno Haible2010-01-091-0/+12