This patch rewrites tests to remove the use of the `unset` command, which is not supported in the lit internal shell. The tests now use the `env -u` to unset environment variables. The `unset` command is used in shell environments to remove the environment variable. However, because the lit internal shell does not support the `unset` command, using it in tests would result in errors or other unexpected behavior. To overcome this limitation, the tests have been updated to use the `env -u` command instead. `env -u` is supported by lit and effectively removes specified environment variables. This allows the tests to achieve the same goal of unsetting environment variables while ensuring compatibility with the lit internal shell. This change is relevant for [[RFC] Enabling the Lit Internal Shell by Default](https://discourse.llvm.org/t/rfc-enabling-the-lit-internal-shell-by-default/80179/3) Fixes: #102397
15 lines
659 B
Plaintext
15 lines
659 B
Plaintext
# AFL doesn't work on Windows. No reason to test the driver.
|
|
UNSUPPORTED: target={{.*(freebsd|windows).*}}
|
|
XFAIL: ios
|
|
RUN: %no_fuzzer_cpp_compiler %S/AFLDriverTest.cpp %libfuzzer_src/afl/afl_driver.cpp -o %t-AFLDriverTest
|
|
|
|
; Test that not specifying a stderr file isn't broken.
|
|
RUN: env -u AFL_DRIVER_STDERR_DUPLICATE_FILENAME %run %t-AFLDriverTest
|
|
|
|
; Test that specifying an invalid file causes a crash.
|
|
RUN: env ASAN_OPTIONS= AFL_DRIVER_STDERR_DUPLICATE_FILENAME="%T" not --crash %run %t-AFLDriverTest
|
|
|
|
; Test that a file is created when specified as the duplicate stderr.
|
|
RUN: env AFL_DRIVER_STDERR_DUPLICATE_FILENAME=%t %run %t-AFLDriverTest
|
|
RUN: stat %t
|