Skip to content

Commit

Permalink
tests: check --always-show-pid option
Browse files Browse the repository at this point in the history
* tests/strace--always-show-pid.c: New file.
* tests/pure_executables.list: Add strace--always-show-pid.
* tests/.gitignore: Likewise.
* tests/gen_tests.in (strace--always-show-pid): New test.
  • Loading branch information
ldv-alt committed May 5, 2024
1 parent 9da5884 commit 2d672be
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -1085,6 +1085,7 @@ status-successful-threads
status-unfinished
status-unfinished-threads
statx
strace--always-show-pid
strace--decode-pids-comm
strace--strings-in-hex
strace--strings-in-hex-all
Expand Down
1 change: 1 addition & 0 deletions tests/gen_tests.in
Original file line number Diff line number Diff line change
Expand Up @@ -1068,6 +1068,7 @@ strace--absolute-timestamps-format-unix-precision-ms +strace-ttt.test 3 --absolu
strace--absolute-timestamps-format-unix-precision-ns +strace-ttt.test 9 --absolute-timestamps=format:unix --absolute-timestamps=precision:ns
strace--absolute-timestamps-format-unix-precision-s +strace-ttt.test 0 --absolute-timestamps=format:unix --absolute-timestamps=precision:s
strace--absolute-timestamps-format-unix-precision-us +strace-ttt.test 6 --absolute-timestamps=precision:us --absolute-timestamps=format:unix
strace--always-show-pid --always-show-pid --trace=fchdir -a15
strace--decode-pids-comm --decode-pids=comm --trace=getppid,tgkill --signal='!SIGCHLD,SIGCONT' -q -f -a 18
strace--follow-forks-output-separately +strace-ff.test --follow-forks --output-separately
strace--relative-timestamps +strace-r.test --relative-timestamps
Expand Down
1 change: 1 addition & 0 deletions tests/pure_executables.list
Original file line number Diff line number Diff line change
Expand Up @@ -784,6 +784,7 @@ status-successful-long
status-successful-status
status-unfinished
statx
strace--always-show-pid
strace--strings-in-hex
strace--strings-in-hex-all
strace--strings-in-hex-non-ascii
Expand Down
22 changes: 22 additions & 0 deletions tests/strace--always-show-pid.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
/*
* Check the PID prefix output with --always-show-pid option.
*
* Copyright (c) 2024 The strace developers.
* All rights reserved.
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/

#include "tests.h"
#include <stdio.h>
#include <unistd.h>

int
main(void)
{
const int pid = getpid();
printf("%-5u fchdir(-1) = %s\n", pid, sprintrc(fchdir(-1)));

printf("%-5u +++ exited with 0 +++\n", pid);
return 0;
}

0 comments on commit 2d672be

Please sign in to comment.