R2R(1)

NAME
r2r - radare2 regression testsuite

SYNOPSIS
r2r [-qvVnLiHh] [-C dir] [-F dir] [-f file] [-o file] [-s test] [-S percent] [-t seconds] [-j threads] [-u] [-g] [test file/dir | @test-type]

DESCRIPTION
r2r is a command-line regression testing framework for Radare2 and its third-party plugins.

It automates the discovery and execution of diverse test suites—including unit tests, JSON validations, fuzz tests, and architecture-specific checks—to ensure that code changes do not introduce regressions.

r2r supports parallel test execution, interactive failure handling, custom timeouts, and filtering of tests by type or name. It integrates seamlessly into continuous integration workflows or can be used locally, and requires only that Radare2 be installed and available in the system PATH.

OPTIONS

-C dir
    Chdir before running r2r (default follows executable symlink + test/new)

-F dir
    Run fuzz tests (open and default analysis) on all files in the given dir

-L  Log mode (better printing for CI, logfiles, etc.)

-V  Verbose

-f file
    File to use for json tests (default is bins/elf/crackme0x00b)

-g  Run the tests specified via '// R2R' comments in modified source files

-h  Print help message

-H  Display environment variables

-i  Interactive mode

-j threads
    How many threads to use for running tests concurrently (default is 8)

-n  Do nothing (don't run any test, just load/parse them)

-o file
    Output test run information in JSON format to file

-q  Quiet

-s test
    Set R2R_SKIP_(TEST)=1 to skip running that test type

-S percent
    Set R2R_SHALLOW=N to skip a random percentage (0-100) of tests

-t seconds
    Timeout per test (default is 3600 seconds)

-u  Do not git pull/clone test/bins (See R2R_OFFLINE)

-v  Show version

ENVIRONMENT

R2R_SKIP_ARCHOS
    Do not run the arch-os-specific tests

R2R_SKIP_JSON
    Do not run the JSON tests

R2R_SKIP_FUZZ
    Do not run the fuzz tests

R2R_SKIP_UNIT
    Do not run the unit tests

R2R_SKIP_CMD
    Do not run the cmd tests

R2R_SKIP_ASM
    Do not run the rasm2 tests

R2R_JOBS
    Maximum parallel jobs (default: 8)

R2R_TIMEOUT
    Timeout in seconds (default: 3600 seconds)

R2R_OFFLINE
    Same as passing -u flag

R2R_SHALLOW
    Skip 0-100% random tests

USAGE

Use the -n flag to not run any test. Just load them.

$ r2r -n [r2r] Loading tests...

Run the tests contained in a directory interactively, if any of those tests fail to run, prompt the user to autofix, edit the commands, etc.

$ r2r -i test/db/cmd/cmd_pdf

Run specific test types using @ notation:

$ r2r @asm # Run assembly tests $ r2r @json # Run JSON tests $ r2r @unit # Run unit tests $ r2r @fuzz # Run fuzz tests $ r2r @arch # Run architecture-specific tests $ r2r @cmd # Run command tests

SEE ALSO

radare2(1)

AUTHORS

Written by pancake <pancake@nopcode.org>.