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

36 lines, 24 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/mycpp-souffle/osh'
22 label = ShellLabels(shell_name, shell_hash, 1)
23 checkEquals('opt/osh-souffle', label)
24
25 shell_name = 'yy/zz/_bin/cxx-opt+bumpleak/osh'
26 label = ShellLabels(shell_name, shell_hash, 1)
27 checkEquals('bumpleak/osh', label)
28}
29
30main = function(argv) {
31 TestShellLabels()
32}
33
34if (length(sys.frames()) == 0) {
35 main(commandArgs(TRUE))
36}