# Integration Test Framework Reference ## `TestLib` A module for the framework. Provides global data and functionality. For ease of use the utility classes are *not* in this module. Provides: * `TMP_DIR` - the temporary directory for the current test run * `CPM_PATH` - path to CPM.cmake. The thing that is being tested * `TEMPLATES_DIR` - path to integration test templates * `CPM_ENV` - an array of the names of all environment variables, which CPM.cmake may read * `.clear_env` - a function to clear all aforementioned environment variables ## `Project` A helper class to manage a CMake project. Provides: * `#initialize(src_dir, bin_dir)` - create a project with a given source and binary directory * `#src_dir`, `#bin_dir` - get project directories * `#create_file(target_path, text, args = {})` - create a file in the project's source directory with a given test. The `args` hash is used to interpolate markup in the text string. * Will set `:cpm_path` in `args` to `TestLib::CPM_PATH` if not already present. * If `:package` is present it will be added to the array `:packages` * Will convert `:packages` form an array to a string * `#create_file_from_template(target_path, source_path, args = {})` - create a file in the project source directory, based on another file in the project source directory. The contents of the file at `source_path` will be read and used in `create_file` * `#create_lists_from_default_template(args = {})` - same as `create_file_from_template('CMakeLists.txt', 'lists.in.cmake', args)` * `::CommandResult` - a struct of: * `out` - the standard output from a command execution * `err` - the standard error output from the execution * `status` - the [`Process::Status`](https://ruby-doc.org/core-2.7.0/Process/Status.html) of the execution * `#configure(extra_args = '') => CommandResult` - configure the project with optional extra args to CMake * `#build(extra_args = '') => CommandResult` - build the project with optional extra args to CMake * `::CMakeCache` - a helper class with the contents of a CMakeCache.txt. Provides: * `::Entry` - a CMake cache entry of: * `val` - the value as string * `type` - the type as string * `advanced?` - whether the entry is an advanced option * `desc` - the description of the entry (can be an empty string) * `::Package` - the CMake cache for a CPM.cmake package. A struct of: * `ver` - the version as string * `src_dir`, `bin_dir` - the source and binary directories of the package * `.from_dir(dir)` - create an instance of `CMakeCache` from `