Sharpie / RTikZDevice

A R package for producing graphics output as PGF/TikZ code for use in TeX documents.
32 stars 36 forks source link

Testsuite does not work with testthat v0.6 #56

Closed Sharpie closed 12 years ago

Sharpie commented 12 years ago

Version 0.6 of testthat moved to using Reference Classes for its object orientation. However, there is now a fatal error whenever the testsuite starts:

Error in envRefInferField(x, what, getClass(class(x)), selfEnv) : 
  "clone" is not a valid field or method name for reference class “refObjectGenerator”
Calls: test_package ... lapply -> FUN -> eval -> eval -> $ -> $ -> envRefInferField
Execution halted

Seems like a bug in testthat, need to reduce a test case and report.

Sharpie commented 12 years ago

Probably not a bug in testthat. The problem is that the custom test reporters used by the tikzDevice assume they are inheriting from mutatr classes instead of reference classes.

This could be a tricky problem. Should be easy to update to reference classes as our minimum supported R version was bumped to 2.12.0 which is the release that introduced reference classes.

However, need to make sure the 2.12.0 reference classes are sufficient to support testthat.

Sharpie commented 12 years ago

Testsuite ported to reference classes. Note that a warning similar to the following will now appear after tests have run:

Warning messages:
1: In getPackageName(where) :
  Created a package name, "2012-01-26 20:07:43", when none found
2: Class "Reporter" is defined (with package slot ‘testthat’) but no metadata object found to revise subclass information---not exported?  Making a copy in package ‘2012-01-26 20:07:43’

This appears to be harmless.