RFR: 8351138: Running subset of gtests gets error printing result information [v3]

SendaoYan syan at openjdk.org
Wed Mar 5 02:10:34 UTC 2025


> Hi all,
> 
> This PR fix the makefile bug when there is no gtest 'disable tests' then report syntax error.
> 
> Before this PR makefile used below command to get the 'disable tests' number, when there is no 'YOU HAVE [0-9]+ DISABLED TEST' string line in gtest result file gtest.txt, this gawk command will not print anything, so shell report syntax error later.
> 
> 
> gawk '/YOU HAVE [0-9]+ DISABLED TEST/ { if (match($0, /[0-9]+/, arr)) { print arr[0]; found=1; } if (!found) { print 0; } }' build/linux-x86_64-server-release/test-results/gtest_Align_server/gtest.txt
> 
> 
> After this PR makefile will use below command to get the 'disable tests' number.
> 
> 
> gawk '/YOU HAVE [0-9]+ DISABLED TEST/ { if (match($0, /YOU HAVE ([0-9]+) DISABLED TEST/, arr)) { print arr[1]; found=1; } } END { if (!found) print 0; }' build/linux-x86_64-server-release/test-results/gtest_Align_server/gtest.txt
> 
> 
> Additional testing:
> 
> - [x] make test TEST=gtest:Align > test-Alian.log, which return 0 disable test
> - [x] time make test TEST=gtest > test-all.log, which return 15 disable tests
> 
> [test-all.log](https://github.com/user-attachments/files/19074190/test-all.log)
> [test-Alian.log](https://github.com/user-attachments/files/19074189/test-Alian.log)

SendaoYan has updated the pull request incrementally with one additional commit since the last revision:

  Revert regex change in if expr

-------------

Changes:
  - all: https://git.openjdk.org/jdk/pull/23904/files
  - new: https://git.openjdk.org/jdk/pull/23904/files/2c167a2a..f798204c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23904&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23904&range=01-02

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/23904.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23904/head:pull/23904

PR: https://git.openjdk.org/jdk/pull/23904


More information about the build-dev mailing list