% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/travisPR_metrics.R
\name{compare_PR}
\alias{compare_PR}
\title{Analyze PR's impact on performance without having to merge.}
\usage{
compare_PR(test_path, metric = "time")
}
\arguments{
\item{test_path}{File-path, relative to the git repo, for the test file to
be tested.}

\item{metric}{The metric (runtime or memory) for which the file is to be 
tested.}
}
\description{
The function must be called from a directory containing only a single git
repository checked out to the branch which is meant to be tested against the
master branch of the repository's remote repo. This function is designed keeping
in mind the PR testing methodlogy of Travis-CI.
Given a test-file path and the required metric, it returns the metric details
of the file against the first commit till the latest common commit for the
git repo, and against the latest commit for master branch of the repo's
remote. It also returns information regarding the latest common commit for
the two directories.
}
\section{Value}{
 compare_brancht returns an object of class "list" containing
  two members.

The first member is a data-frame and consists of the following columns:
\code{test_name}
\code{metric_name}
\code{status}
\code{metric_val}
\code{message}
\code{sha}
\code{date_time}
\code{directory}

The second member is a data-frame and consists of the following columns:
\code{common_datetime}
\code{common_message}
\code{cnum_b1}
\code{cnum_b2}
}

\section{Warning}{

  Function assumes the current directory to be the parent directory of the 
  the repository being tested.
}
\examples{

\dontrun{
# Set the current directory to the parent directory of the concerned repository.
setwd("./Path/to/parent/directory")

# Set the file-path
t_path <- "Path/to/file"

# Load the library and pass the parameters to the function
library(Rperform)
compare_PR(t_path, metric = "time")
}

}

