---
name: "Arch::Test::Framework"
section: "3pm"
platform: "linux"
package: "libarch-perl"
version: "0.5.2-2"
release: "Debian 11 (Bullseye)"
platforms: ["linux"]
url: "https://new.carta.tech/Arch::Test::Framework"
---

# Arch::Test::Framework(3pm)

A test framework for Arch-Perl

## NAME

Arch::Test::Framework - A test framework for Arch-Perl

## SYNOPSIS

```
    use Arch::Test::Framework;
    my $fw = Arch::Test::Framework->new;
    my $archive = $fw->make_archive;
    my $version = $archive->make_version();
    my $tree = $fw->make_tree($version);
    #
    # do something with $tree
    #
    $tree->import('initial import');
```

## DESCRIPTION

Arch::Test::Framework is a framework to quickly generate testing data (archives, versions, trees, changesets, etc) for arch-perl unit tests.

## METHODS

**new**, **arch\_uid**, **home\_dir**, **library\_dir**, **archives\_dir**, **trees\_dir**, **make\_archive**, **make\_category**, **make\_branch**, **make\_version**, **make\_tree**.

- **new** \[*%args*\]

  Create a new arch-perl test environment.

  Valid keys for *%args* are *home* to specify an existing test environment to reuse, *library* to specify a different revision library path, *archives* to specify a different archives directory, and *trees* to specify a differente project tree directory. The default values are `"$home/library"`, `"$home/archives"`, and `"$home/trees"` respectively.

  A different arch user id can be selected with the *userid* key, the default is `"Arch Perl Test <arch-perl-test@example.com>"`.

- **arch\_uid**

  - **home\_dir**

  - **library\_dir**

  - **archives\_dir**

  - **trees\_dir**

  These methods return the environment parameters as initialized by **new**.

- **make\_archive** \[*archive\_name*\]

  Create a new archive in the archives directory. If *archive\_name* is not specified a unique name is generated. The archive name is returned. Returns an Arch::Test::Archive reference for the archive.

- **make\_tree** *version* \[*name*\]

  Create and initialize (`"tla init-tree"`) a new project tree for *version*. I *name* is not specified, a unique identifier will be generated. Returns an Arch::Test::Tree reference for the project tree.

## AUTHORS

Mikhael Goikhman (migo@homemail.com--Perl-GPL/arch-perl--devel).

Enno Cramer (uebergeek@web.de--2003/arch-perl--devel).
