- NAME
- NOTES
  - COVERAGE
- UTILITIES
  - load_or_create_user
  - load_or_create_queue
  - load_or_create_custom_field
  - get_relocatable_dir
  - get_relocatable_file

# NAME

RT::Test - RT Testing

# NOTES

## COVERAGE

To run the rt test suite with coverage support, install Devel::Cover and run:

        make test RT_DBA_USER=.. RT_DBA_PASSWORD=.. HARNESS_PERL_SWITCHES=-MDevel::Cover
        cover -ignore_re '^var/mason_data/' -ignore_re '^t/'

The coverage tests have DevelMode turned off, and have `named_component_subs` enabled for HTML::Mason to avoid an optimizer problem in Perl that hides the top-level optree from Devel::Cover.

# UTILITIES

## load_or_create_user

## load_or_create_queue

## load_or_create_custom_field

## get_relocatable_dir

Takes a path relative to the location of the test file that is being run and returns a path that takes the invocation path into account.

e.g. `RT::Test::get_relocatable_dir(File::Spec-`updir(), 'data', 'emails')>

Parent directory traversals (`..` or File::Spec->updir()) are naively canonicalized based on the test file path (`$0`) so that symlinks aren't followed. This is the exact opposite behaviour of most filesystems and is considered "wrong", however it is necessary for some subsets of tests which are symlinked into the testing tree.

## get_relocatable_file

Same as get_relocatable_dir, but takes a file and a path instead of just a path.

e.g. RT::Test::get_relocatable_file('test-email', (File::Spec->updir(), 'data', 'emails'))

← Back to index