t::PBS

get_global_warp_mode

Returns the global warp mode. This method is static and can be used without an object.

set_global_warp_mode

Sets the global warp mode. This method is static and can be used without an object.

new

Constructor. Accepts the same arguments as the constructor in the base class, with the exception of prog and workdir. prog is set to pbs, and workdir is set to create a new temporary directory. First, pbs is searched for as ./blib/script/pbs.pl, and if not found there, as /usr/bin/env pbs. If the process is running under Devel::Cover and Test::Harness, the sub Perl processes is started with Devel::Cover too, with the coverage data base path set to ./cover_db. After all the preciding, the current directory is changed to the temporary directory.

write

The same as in the base class, but an exception is thrown on error.

write_pbsfile

The same as write, but the file name is set to Pbsfile.pl.

command_line_flags

Sets/returns the current command line flags used when calling pbs.

build_dir

Sets/returns the build directory.

target

Sets/returns the target.

get_target_with_path

Returns the target with path relative the temporary directory.

build

Calls pbs with the appropriate command line arguments. If the keyword argument targets is given, the current target is not used, and instead is this argument appended to the command line. Forwards all given arguments to run in the base class.

build_test

The same as build but also fails a test if the exit code from pbs is signalling an error.

build_test_fail

The same as build but also fails a test if the exit code from pbs is signalling success.

run

Runs the program given as argument. The path to the program is assumed relative the temporary directory.

run_target

Runs the current target file.

run_target_test

Runs the target and tests if the standard output from the target is equal to the keyword argument stdout.

test_up_to_date

Calls pbs, and fails a test if something were built.

test_file_exist

Fails a test if the file given as argument does not exist.

test_file_exist_in_build_dir

Fails a test if the file given as argument does not exist. The path to the file is assumed relative the build directory.

test_file_not_exist

The opposite to test_file_exist.

test_file_not_exist_in_build_dir

The opposite to test_file_exist_in_build_dir.

remove_file_from_build_dir

Deletes the file given as argument. Raises an exception if unsuccessful. The path to the file is assumed relative the build directory.

test_file_contents

Fails a test if the contents of the file given as the first argument does not match the second argument. Raises an exception if the file cannot be read.

test_file_contents_regex

Fails a test if the contents of the file given as the first argument does not match the second argument, interpreted as a regular expression. Raises an exception if the file cannot be read.

test_target_contents

Fails a test if the contents of the target file does not match the argument. Raises an exception if the target file cannot be read.

test_node_was_rebuilt

Fails a test if the file given as argument was not built/rebuilt in the last run of pbs. This method assumes that a post-pbs script is given to pbs in the flags, which prints the names of the files built/rebuilt on standard output, one filename on each line.

test_node_was_not_rebuilt

The opposite to test_node_was_rebuilt.

dump_stdout_stderr

Dump stdout, stderr.

catfile_pbs

Concatenate one or more directory names and a filename to form a complete path ending with a filename. This is the same as catfile, but this sub uses slashes as path separators, for use in PBS-files.

here_pbs

Returns the absolute path name of the current working directory. This is the same as here, but this sub uses slashes as path separators, for use in PBS-files.

generate_test_snapshot_and_exit

Copies the temporary directory to /tmp/pbs_test_snapshot and stops the tests. Use this to manually debug a test case.

start_cwd

Returns the absolute path name of the directory that was the current working directory at the start.

setup_test_data

Copies all files and directories (recursively) from a source directory to the current directory. The source directory is a specified subdirectory of the 't/setup_data' subdirectory of the start directory.

setup_test_data_file

Copies a single file from a source directory to the current directory. The source directory is a specified subdirectory of the 't/setup_data' subdirectory of the start directory.