From 2a6cfc5643053117b3baa301b91afaf9fc5edede Mon Sep 17 00:00:00 2001 From: Aiden Grossman Date: Fri, 12 Jun 2026 03:28:16 +0000 Subject: [PATCH] [Fuzzer] Make two tests compatible with the internal shell. (#203448) 1. Remove redundant parntheses that broke the internal shell's parsing logic. 2. Use env when specifying environment variables. 3. Rewrite a bash one-line loop in python. --- compiler-rt/test/fuzzer/features_dir.test | 2 +- compiler-rt/test/fuzzer/merge-posix.test | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler-rt/test/fuzzer/features_dir.test b/compiler-rt/test/fuzzer/features_dir.test index c6beec01bc3a..ae2432a31a38 100644 --- a/compiler-rt/test/fuzzer/features_dir.test +++ b/compiler-rt/test/fuzzer/features_dir.test @@ -4,4 +4,4 @@ RUN: %cpp_compiler %S/SimpleTest.cpp -o %t-SimpleTest RUN: rm -rf %t-C %t-F RUN: mkdir %t-C %t-F RUN: not %run %t-SimpleTest %t-C -features_dir=%t-F -RUN: for c in %t-C/*; do f=%t-F/$(basename $c); echo looking for $f; [ -a $f ]; done +RUN: %python -c "import glob; import os; assert all([os.path.exists(f'%t-F/{os.path.basename(file_path)}') for file_path in list(glob.glob('%t-C/*'))])" diff --git a/compiler-rt/test/fuzzer/merge-posix.test b/compiler-rt/test/fuzzer/merge-posix.test index 26af82880761..28d72b0bbb12 100644 --- a/compiler-rt/test/fuzzer/merge-posix.test +++ b/compiler-rt/test/fuzzer/merge-posix.test @@ -18,9 +18,9 @@ RUN: echo ....E. > %tmp/T2/5 RUN: %python -c "print('.....R' + 'X' * 4096, end='')" > %tmp/T2/6 # Check that we can report an error if file size exceeded -RUN: (ulimit -f 4; not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ) +RUN: ulimit -f 4; not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=SIGXFSZ SIGXFSZ: ERROR: libFuzzer: file size exceeded # Check that we honor TMPDIR -RUN: TMPDIR=DIR_DOES_NOT_EXIST not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=TMPDIR +RUN: env TMPDIR=DIR_DOES_NOT_EXIST not %run %t-FullCoverageSetTest -merge=1 %tmp/T1 %tmp/T2 2>&1 | FileCheck %s --check-prefix=TMPDIR TMPDIR: MERGE-OUTER: failed to write to the control file: DIR_DOES_NOT_EXIST/libFuzzerTemp