brodieG / unitizer
Showing 43 of 59 files from the diff.

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 
@@ -69,7 +69,7 @@
Loading
69 69
#' keep their evaluation environment.  Often this environment is similar
70 70
#' to the new environment.  When there are difference between the two,
71 71
#' the output of \code{ls} is customized to highlight
72 -
#' which objects were actually available/unmodifed at the time of the
72 +
#' which objects were actually available/unmodified at the time of the
73 73
#' reference test evaluation.  Object names will have the following
74 74
#' symbols appended to explain the object status:
75 75
#' \itemize{

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 
@@ -826,6 +826,8 @@
Loading
826 826
    env.sec <- if(!is.null(item.new) && !is.null(item.ref))
827 827
      item.ref@env else NULL
828 828
    assign("ls", unitizer_ls, base.env.pri)
829 +
    assign(".traceback", unitizer_dottraceback, base.env.pri)
830 +
    assign("traceback", unitizer_traceback, base.env.pri)
829 831
    if(!is.null(env.sec)) {
830 832
      assign("ref", function(x) eval(substitute(x), env.sec), base.env.pri)
831 833
    } else {

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -0,0 +1,103 @@
Loading
1 +
# Copyright (C) 2021 Brodie Gaslam
2 +
# 
3 +
# This file is part of "unitizer"
4 +
# 
5 +
# This program is free software: you can redistribute it and/or modify
6 +
# it under the terms of the GNU General Public License as published by
7 +
# the Free Software Foundation, either version 2 of the License, or
8 +
# (at your option) any later version.
9 +
# 
10 +
# This program is distributed in the hope that it will be useful,
11 +
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12 +
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13 +
# GNU General Public License for more details.
14 +
# 
15 +
# Go to <https://www.r-project.org/Licenses/GPL-2> for a copy of the license.
16 +
17 +
# Code in this file is adapted from the R functions `traceback` and
18 +
# `.traceback` in the base R package.  Original copyright notice:
19 +
#
20 +
#  File src/library/base/R/traceback.R
21 +
#  Part of the R package, https://www.R-project.org
22 +
#
23 +
#  Copyright (C) 1995-2019 The R Core Team
24 +
#
25 +
#  This program is free software; you can redistribute it and/or modify
26 +
#  it under the terms of the GNU General Public License as published by
27 +
#  the Free Software Foundation; either version 2 of the License, or
28 +
#  (at your option) any later version.
29 +
#
30 +
#  This program is distributed in the hope that it will be useful,
31 +
#  but WITHOUT ANY WARRANTY; without even the implied warranty of
32 +
#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
33 +
#  GNU General Public License for more details.
34 +
#
35 +
#  A copy of the GNU General Public License is available at
36 +
#  https://www.R-project.org/Licenses/
37 +
38 +
unitizer_traceback <-  function(
39 +
  x = NULL, max.lines = getOption("traceback.max.lines", 
40 +
  getOption("deparse.max.lines", -1L))
41 +
) {
42 +
  n <- length(x <- unitizer_dottraceback(x, max.lines = max.lines))
43 +
  if (n == 0L) 
44 +
      cat(gettext("No traceback available"), "\n")
45 +
  else {
46 +
    for (i in 1L:n) {
47 +
      xi <- x[[i]]
48 +
      label <- paste0(n - i + 1L, ": ")
49 +
      m <- length(xi)
50 +
      srcloc <- if (!is.null(srcref <- attr(xi, "srcref"))) {
51 +
        srcfile <- attr(srcref, "srcfile")
52 +
        paste0(" at ", basename(srcfile$filename), "#", srcref[1L])
53 +
      }
54 +
      if (isTRUE(attr(xi, "truncated"))) {
55 +
        xi <- c(xi, " ...")
56 +
        m <- length(xi)
57 +
      }
58 +
      if (!is.null(srcloc)) {
59 +
        xi[m] <- paste0(xi[m], srcloc)
60 +
      }
61 +
      if (m > 1) 
62 +
        label <- c(
63 +
          label, 
64 +
          rep(substr("          ", 1L, nchar(label, type = "w")), m - 1L)
65 +
        )
66 +
      cat(paste0(label, xi), sep = "\n")
67 +
    }
68 +
  }
69 +
  invisible(x)
70 +
}
71 +
unitizer_dottraceback <- function (
72 +
  x = NULL, max.lines = getOption("traceback.max.lines", 
73 +
  getOption("deparse.max.lines", -1L))
74 +
) {
75 +
    if(!is.null(x))
76 +
      stop(
77 +
        "You are using an overloaded `.traceback` that requires `x` to be ",
78 +
        "NULL; you can use standard `traceback` with `base::traceback`."
79 +
      )
80 +
    stopifnot(length(max.lines) <= 1)
81 +
    .is.positive.intlike <- function(x) 
82 +
      is.numeric(x) && length(x) == 1L && !is.na(x) && as.integer(x) >= 0L
83 +
84 +
    if (is.null(x) && !is.null(x <- .global$traceback)) {
85 +
      valid.max.lines <- .is.positive.intlike(max.lines)
86 +
      nlines <- if (valid.max.lines) max.lines + 1L
87 +
      else max.lines
88 +
      for (i in seq_along(x)) {
89 +
        srcref <- attr(x[[i]], "srcref")
90 +
        # unitizer's own traceback used the "keepInteger" control prior to
91 +
        # change in 1.4.13.
92 +
        if (typeof(x[[i]]) == "language") 
93 +
            x[[i]] <- deparse(x[[i]], nlines = nlines, control="keepInteger")
94 +
        if (valid.max.lines && length(x[[i]]) > max.lines) {
95 +
            x[[i]] <- x[[i]][seq_len(max.lines)]
96 +
            attr(x[[i]], "truncated") <- TRUE
97 +
        }
98 +
        attr(x[[i]], "srcref") <- srcref
99 +
      }
100 +
    }
101 +
    x
102 +
}
103 +

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 
@@ -350,11 +350,10 @@
Loading
350 350
    trace=tail(trace, -1L)
351 351
  )
352 352
}
353 +
## Trace is undeparsed
354 +
353 355
set_trace <- function(trace) {
354 -
  if(length(trace)) {
355 -
    res <- lapply(FUN=deparse, rev(trace), control="keepInteger")
356 -
    assign(".Traceback", res, envir=getNamespace("base"))
357 -
  }
356 +
  if(length(trace)) .global$traceback <- rev(trace)
358 357
  TRUE
359 358
}
360 359
get_trace <- function(trace.base, trace.new, printed, exp) {

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
#
3 3
# This file is part of "unitizer"
4 4
#

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 

@@ -1,4 +1,4 @@
Loading
1 -
# Copyright (C) 2020  Brodie Gaslam
1 +
# Copyright (C) 2021 Brodie Gaslam
2 2
# 
3 3
# This file is part of "unitizer"
4 4
# 
Files Coverage
R 93.33%
Project Totals (43 files) 93.33%
Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading