| 1 | #!/usr/bin/env Rscript
 | 
| 2 | #
 | 
| 3 | # benchmarks/report_test.R
 | 
| 4 | 
 | 
| 5 | source('benchmarks/report.R')
 | 
| 6 | 
 | 
| 7 | library(RUnit)
 | 
| 8 | 
 | 
| 9 | TestShellLabels = 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 | 
 | 
| 26 | main = function(argv) {
 | 
| 27 |   TestShellLabels()
 | 
| 28 | }
 | 
| 29 | 
 | 
| 30 | if (length(sys.frames()) == 0) {
 | 
| 31 |   main(commandArgs(TRUE))
 | 
| 32 | }
 |