OILS / benchmarks / report_test.R View on Github | oilshell.org

32 lines, 21 significant
1#!/usr/bin/env Rscript
2#
3# benchmarks/report_test.R
4
5source('benchmarks/report.R')
6
7library(RUnit)
8
9TestShellLabels = function() {
10 shell_name = '_bin/cxx-opt/osh'
11 shell_hash = 'abcdef'
12 d = data.frame(shell_hash = c('abcdef'))
13
14 label = ShellLabels(shell_name, shell_hash, 1)
15 checkEquals('opt/osh', label)
16
17 shell_name = 'yy/zz/_bin/cxx-opt/osh'
18 label = ShellLabels(shell_name, shell_hash, 1)
19 checkEquals('opt/osh', label)
20
21 shell_name = 'yy/zz/_bin/cxx-opt+bumpleak/osh'
22 label = ShellLabels(shell_name, shell_hash, 1)
23 checkEquals('bumpleak/osh', label)
24}
25
26main = function(argv) {
27 TestShellLabels()
28}
29
30if (length(sys.frames()) == 0) {
31 main(commandArgs(TRUE))
32}