[all-commits] [llvm/llvm-project] 17eb0e: [clang][ssaf] Skip permission-based tests when per...

Aviral Goel via All-commits all-commits at lists.llvm.org
Tue Feb 24 11:39:14 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 17eb0ebee85dc89d00a445ac364cd3e3b14ef535
      https://github.com/llvm/llvm-project/commit/17eb0ebee85dc89d00a445ac364cd3e3b14ef535
  Author: Aviral Goel <aviralg at users.noreply.github.com>
  Date:   2026-02-24 (Tue, 24 Feb 2026)

  Changed paths:
    M clang/unittests/Analysis/Scalable/Serialization/JSONFormatTest/JSONFormatTest.h
    M clang/unittests/Analysis/Scalable/Serialization/JSONFormatTest/TUSummaryTest.cpp

  Log Message:
  -----------
  [clang][ssaf] Skip permission-based tests when permissions are not enforced (#183128)

`JSONFormatTest/NoReadPermission` and
`JSONFormatTest/WriteStreamOpenFailure` are negative tests that expect
file operations to fail when Unix permissions are revoked. These tests
unexpectedly succeed instead of failing if they are run as root, or
executed in environments with non-standard filesystem semantics that do
not enforce permission checks.

This change adds a `permissionsAreEnforced()` helper to the
`JSONFormatTest` fixture that detects if:
  - The process is running as root `(getuid() == 0)`
- A probe file with read permission removed can still be opened,
indicating that file permission has no effect in the current
environment. The probe file's permissions are restored before returning
so `TearDown` can clean up the temp directory unconditionally.

This method is used to skip the two negative tests rather than failing
with a spurious assertion error.

rdar://170917013
rdar://170916929



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list