[Rprotobuf-yada] c++ class names
Dirk Eddelbuettel
edd at debian.org
Tue Dec 8 17:59:44 CET 2009
On 8 December 2009 at 08:05, Romain François wrote:
| That sounds interesting. I think I used this technique before at mango.
I just checked, I also have a working example in rquantlib. I can apply that,
esp we switch to RUnit :)
| BTW. we should ge back at using the mailing list.
Yup. Doing so now.
Dirk
| On 12/07/2009 01:38 PM, Dirk Eddelbuettel wrote:
| >
| > On 7 December 2009 at 06:12, Romain François wrote:
| > | On 12/06/2009 09:00 PM, Dirk Eddelbuettel wrote:
| > |> On 6 December 2009 at 20:06, Romain François wrote:
| > |> |> No hurries. Could we place the tests into the tests/ directory but call them
| > |> |> from the vignette via source("../../tests/foo.R") ?
| > |> |
| > |> | I'd use system.file("tests", "somefile.R", package = "RProtoBuf" ) from
| > |> | the vignette.
| > |>
| > |> That only uses the _installed version_ which is inferior, in my book, to
| > |> using the tests/ directory.
| > |
| > | when you "R CMD build", which is how I make the vignettes, system.file
| > | uses the one you are building.
| > |
| > | The problem with ../../tests is that it does not work with the installed
| > | version, because "inst" disappears.
| >
| > There is the RUnit solution introduced by Gregor G / Martin M. I'll try to
| > look it up again and present it -- we should be able to do the same for
| > svUnit if these are really that close.
| >
| > The trick, as I recall, was to keep real tests in
| >
| > inst/tests/
| >
| > and have
| >
| > tests/
| >
| > contain a script that loops over inst/tests/ when using sources where as the
| > installed tests/ (formerly inst/tests/) is used otherwise.
| >
| > See any of the Rmetrics packages:
| >
| > edd at ron:~/src/debian/CRAN$ cat timeSeries-2100.84/tests/doRUnit.R
| > #### doRUnit.R --- Run RUnit tests
| > ####------------------------------------------------------------------------
| >
| > ### Origianlly follows Gregor Gojanc's example in CRAN package 'gdata'
| > ### and the corresponding section in the R Wiki:
| > ### http://wiki.r-project.org/rwiki/doku.php?id=developers:runit
| >
| > ### MM: Vastly changed: This should also be "runnable" for *installed*
| > ## package which has no ./tests/
| > ## ----> put the bulk of the code e.g. in ../inst/unitTests/runTests.R :
| >
| > if(require("RUnit", quietly = TRUE)) {
| >
| > ## --- Setup ---
| >
| > wd<- getwd()
| > pkg<- sub("\\.Rcheck$", '', basename(dirname(wd)))
| >
| > library(package = pkg, character.only=TRUE)
| >
| > path<- system.file("unitTests", package = pkg)
| >
| > stopifnot(file.exists(path), file.info(path.expand(path))$isdir)
| >
| > source(file.path(path, "runTests.R"), echo = TRUE)
| > }
| >
| >
| > ################################################################################
| >
| > edd at ron:~/src/debian/CRAN$
| >
| >
| > and then also
| >
| >
| > edd at ron:~/src/debian/CRAN$ ls -1 timeSeries-2100.84/inst/unitTests/
| > Makefile
| > runit.aggregate.R
| > runit.align.R
| > runit.apply.R
| > runit.as.R
| > runit.attach.R
| > runit.bind.R
| > runit.colCum.R
| > runit.colStats.R
| > runit.cor.R
| > runit.cumulated.R
| > runit.daily.R
| > runit.dim.R
| > runit.drawdowns.R
| > runit.durations.R
| > runit.lag.R
| > runit.mathOps.R
| > runit.merge.R
| > runit.methods-plot.R
| > runit.methods-print.R
| > runit.methods-summary.R
| > runit.model.frame.R
| > runit.monthly.R
| > runit.na.contiguous.R
| > runit.NA.R
| > runit.Omit.R
| > runit.order.R
| > runit.periodical.R
| > runit.rank.R
| > runit.returns.R
| > runit.rowCum.R
| > runit.signalCounts.R
| > runit.spreads.R
| > runit.subset.R
| > runit.time.R
| > runit.TimeSeriesClass.R
| > runit.TimeSeriesCoercion.R
| > runit.TimeSeriesData.R
| > runit.TimeSeriesPositions.R
| > runit.timeSeries.R
| > runTests.R
| > edd at ron:~/src/debian/CRAN$
| >
| > Dirk
| >
| > |> | I don't really remember. I'll have to look into the code next week. In
| > |> | the thread we had in the rcpp mailing list, i wanted vector<string> ->
| > |> | SEXP but I don't remember why right now.
| > |>
| > |> Ack.
| > |>
| > |> Dirk
| > |>
| > |
| > |
| > | --
| > | Romain Francois
| > | Professional R Enthusiast
| > | +33(0) 6 28 91 30 30
| > | http://romainfrancois.blog.free.fr
| > | |- http://tr.im/Gq7i : ohloh
| > | |- http://tr.im/FtUu : new package : highlight
| > | `- http://tr.im/EAD5 : LondonR slides
| > |
| >
|
|
| --
| Romain Francois
| Professional R Enthusiast
| +33(0) 6 28 91 30 30
| http://romainfrancois.blog.free.fr
| |- http://tr.im/Gq7i : ohloh
| |- http://tr.im/FtUu : new package : highlight
| `- http://tr.im/EAD5 : LondonR slides
|
--
Three out of two people have difficulties with fractions.
More information about the Rprotobuf-yada
mailing list