[Rprotobuf-yada] bytes

Dirk Eddelbuettel edd at debian.org
Wed Oct 13 21:28:31 CEST 2010


On 12 October 2010 at 15:21, eckuipers-web at yahoo.com wrote:
| One test bombs but that has nothing to do with my changes i think. RUnit can't 
| parse the R file runit.addressbook.R which is odd since it seems perfectly fine 
| to me.

There was at least a missing } but I am currently getting an error from this
and am scratching my head...

| I can add some unittests later in the week with respect to raws and my 
| changes...

Saw that you now sent this -- very nice.

Dirk

PS A tiny helper I keep to help with Rcpp et al unit tests. I use littler
('r'), can be retooled for Rscript too I suppose.



#!/bin/sh

set -u 
set -e

progname=`basename $0`
options='p:h?'
 
usage_and_exit()
{
    echo "Usage: $progname [-p package[,package2,..]] [-?|-h]"
    echo "  Run unit test script for R package"
    echo "Options:"
    echo "  -p package[,package2,..]]  load additional package(s)"
    echo "  -h                         show this help"
    exit 0
}

while getopts "$options" i 
do 
    case "$i" in
	p)
	    pkg=",$OPTARG"
	    shift 
	    shift
	    ;;
	h|?)
	    usage_and_exit
	    ;;
    esac
done

if [ ! -f $1 ]; then
    echo "Error: No file '$1' found"
    exit 1
fi

file=`pwd`/$1

r -t -lRUnit${pkg} -e"cppfunction <- function(...) cxxfunction(..., plugin=\"Rcpp\"); runTestFile(\"$file\")"

-- 
Dirk Eddelbuettel | edd at debian.org | http://dirk.eddelbuettel.com


More information about the Rprotobuf-yada mailing list