# 使用 Homebrew, apk, MacPorts, Nix, apt, dnf 安装 atf

查看 atf 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:atf
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install atf
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install atf
```

  证据: MacPorts ports tree: devel/atf/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add atf
```

  证据: Alpine Linux edge package indexes: atf from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz

- Nix (92%):

```sh
nix profile install nixpkgs#atf
```

  证据: nixpkgs package indexes: pkgs/by-name/at/atf/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

- Debian apt (92%):

```sh
sudo apt install atf-sh
```

  证据: Debian stable package indexes: atf-sh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install atf-tests
```

  证据: Fedora Rawhide package metadata: atf-tests from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

## 软件包事实

- **软件包键:** brew:atf
- **软件包管理器:** Homebrew
- **版本:** 0.23
- **来源摘要:** Automated testing framework
- **主页:** <https://github.com/freebsd/atf>
- **仓库:** <https://github.com/freebsd/atf>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- atf-sh (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 0.23
## 项目历史与用法

ATF, the Automated Testing Framework, is a small but historically important Unix testing framework for writing test programs in C, C++, and POSIX shell. Its value is less about being a fashionable standalone test runner and more about providing a consistent test-program API and command-line interface for base-system and ports/package test suites.

### 项目历史

The official README describes ATF as libraries for C, C++, and POSIX shell, with ATF-based tests relying on an external execution engine rather than shipping one itself. The same README identifies Kyua as the preferred execution engine, which reflects ATF's later role as the test-definition layer inside a larger BSD testing stack.

The NEWS file records a major 2014 transition: version 0.19 moved project hosting from Google Code, where ATF had been a Kyua subproject, to GitHub as a first-class project. That release also separated deprecated tools such as atf-run and atf-report from the maintained libraries, foreshadowing the modern split where Kyua handles execution.

### 采用历史

ATF is strongly associated with BSD operating-system testing. The README explicitly recommends binary packages for FreeBSD, NetBSD/pkgsrc, OpenBSD, and Ubuntu, and the NEWS file calls out FreeBSD test-suite support in the 0.19 release. That made ATF familiar to package maintainers who care about base-system regression tests, portable shell tests, and tests shipped alongside system components.

Its package-manager footprint is broad for such a specialized tool: the input lists packages in Homebrew, MacPorts, pkgsrc-adjacent systems, Debian/Ubuntu, Fedora, Nix, and Alpine. That packaging spread matters because ATF tests are often consumed by downstream distributions rather than only by application developers.

### 使用方式

ATF is used to write test cases in C, C++, or shell that expose a consistent interface to humans and automation. In practice, users commonly install ATF alongside Kyua, write tests with atf-c, atf-c++, or atf-sh, and let Kyua discover and run them.

The Homebrew formula exposes at least the atf-sh executable, which is the part many command-line package users encounter first when running or authoring shell-based tests.

### 为什么软件包爱好者会关心

ATF is package-nerd infrastructure: it is not glamorous, but it sits in the plumbing between source trees, operating-system test suites, and downstream package validation. Its removal of the old runner tools in favor of Kyua is the sort of split that explains why different packages may depend on atf libraries, atf-sh, or Kyua separately.

The long quiet period between the 2014 0.21 release and later 2024/2025 releases is also notable for maintainers: old system-test tooling can remain relevant for a decade when it is embedded in OS and packaging workflows.

### 时间线

- 2014: ATF 0.19 moved from Google Code to GitHub and separated deprecated runner/reporting tools.
- 2014: ATF 0.20 removed the deprecated tools from the maintained release line.
- 2014: ATF 0.21 restored and refreshed manual-page documentation and improved FreeBSD-current compatibility.
- 2024: ATF 0.22 refreshed the codebase for modern C++ and build-system compatibility.
- 2025: ATF 0.23 fixed release tarball generation and other build/test issues.

### Related projects

- Kyua is the preferred execution engine for ATF-based tests.
- FreeBSD's test suite is a major downstream context for ATF.
- pkgsrc, OpenBSD ports, Debian/Ubuntu, and other package systems distribute ATF or ATF shell tooling.

### 来源

- <https://github.com/freebsd/atf#readme>
- <https://raw.githubusercontent.com/freebsd/atf/master/NEWS>


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals

## 其他软件包管理器记录

- Debian apt - atf-sh - 0.22-3: normalized package name match | Debian stable package indexes: atf-sh from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Automated Test Framework (shell library) | https://github.com/freebsd/atf
- Debian apt - libatf-c++-2 - 0.22-3: normalized package name match | Debian stable package indexes: libatf-c++-2 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Automated Test Framework (shared C++ library) | https://github.com/freebsd/atf
- Debian apt - libatf-c-1 - 0.22-3: normalized package name match | Debian stable package indexes: libatf-c-1 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Automated Test Framework (shared C library) | https://github.com/freebsd/atf
- Debian apt - libatf-dev - 0.22-3: normalized package name match | Debian stable package indexes: libatf-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Automated Test Framework (development files) | https://github.com/freebsd/atf
- Nix - atf: normalized package name match | nixpkgs package indexes: pkgs/by-name/at/atf/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - atf-sh - 0.21-6build4: normalized package name match | Ubuntu 24.04 LTS package indexes: atf-sh from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Automated Test Framework (shell library) | https://github.com/jmmv/atf
- Ubuntu apt - libatf-c++-2 - 0.21-6build4: normalized package name match | Ubuntu 24.04 LTS package indexes: libatf-c++-2 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Automated Test Framework (shared C library) | https://github.com/jmmv/atf
- Ubuntu apt - libatf-c-1 - 0.21-6build4: normalized package name match | Ubuntu 24.04 LTS package indexes: libatf-c-1 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Automated Test Framework (shared C++ library) | https://github.com/jmmv/atf
- Ubuntu apt - libatf-dev - 0.21-6build4: normalized package name match | Ubuntu 24.04 LTS package indexes: libatf-dev from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | Automated Test Framework (development files) | https://github.com/jmmv/atf
- apk - atf - 0.23-r0: normalized package name match | Alpine Linux edge package indexes: atf from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | libraries to write tests in C, C++ and shell | https://github.com/freebsd/atf
- apk - atf-dev - 0.23-r0: normalized package name match | Alpine Linux edge package indexes: atf-dev from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | libraries to write tests in C, C++ and shell (development files) | https://github.com/freebsd/atf
- apk - atf-doc - 0.23-r0: normalized package name match | Alpine Linux edge package indexes: atf-doc from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | libraries to write tests in C, C++ and shell (documentation) | https://github.com/freebsd/atf
- apk - atf-static - 0.23-r0: normalized package name match | Alpine Linux edge package indexes: atf-static from https://dl-cdn.alpinelinux.org/alpine/edge/main/x86_64/APKINDEX.tar.gz | libraries to write tests in C, C++ and shell (static library) | https://github.com/freebsd/atf
- dnf - atf-tests - 0.23-5.fc45: normalized package name match | Fedora Rawhide package metadata: atf-tests from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Automated Testing Framework - Test suite | https://github.com/freebsd/atf
- dnf - libatf-c - 0.23-5.fc45: normalized package name match | Fedora Rawhide package metadata: libatf-c from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Automated Testing Framework - C bindings | https://github.com/freebsd/atf
- dnf - libatf-c++ - 0.23-5.fc45: normalized package name match | Fedora Rawhide package metadata: libatf-c++ from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Automated Testing Framework - C++ bindings | https://github.com/freebsd/atf


## Combined YAML source

View the package source record on GitHub. [combined/atf.yml](https://github.com/mxcl/pkgdb/blob/main/combined/atf.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
