Skip to content

Commit 896c4b7

Browse files
committed
new binary test of pre-built .deb package
intented for Travis only, with test for Linux && Travis && extended tests will help to ensure we do not accidentally alter the ABI
1 parent 4bd9d1c commit 896c4b7

11 files changed

+149
-0
lines changed

.Rinstignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
inst/doc/Makefile
22
inst/doc/jss.bst
33
inst/doc/RJournal.sty
4+
inst/unitTests/bin
5+
inst/unitTests/src
Binary file not shown.
15.8 KB
Binary file not shown.
Lines changed: 61 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,61 @@
1+
#!/usr/bin/r -t
2+
#
3+
# Copyright (C) 2014 Dirk Eddelbuettel
4+
#
5+
# This file is part of Rcpp.
6+
#
7+
# Rcpp is free software: you can redistribute it and/or modify it
8+
# under the terms of the GNU General Public License as published by
9+
# the Free Software Foundation, either version 2 of the License, or
10+
# (at your option) any later version.
11+
#
12+
# Rcpp is distributed in the hope that it will be useful, but
13+
# WITHOUT ANY WARRANTY; without even the implied warranty of
14+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15+
# GNU General Public License for more details.
16+
#
17+
# You should have received a copy of the GNU General Public License
18+
# along with Rcpp. If not, see <http://www.gnu.org/licenses/>.
19+
20+
.onLinux <- .Platform$OS.type == "unix" && unname(Sys.info()["sysname"]) == "Linux"
21+
22+
.onTravis <- Sys.getenv("TRAVIS") != ""
23+
24+
.runThisTest <- Sys.getenv("RunAllRcppTests") == "yes"
25+
26+
test.binary.testRcppPackage <- function() {
27+
28+
if (.runThisTest && .onLinux && .onTravis) {
29+
30+
pkg <- "r-cran-testrcpppackage"
31+
32+
## R calls it i686 or x86_64; Debian/Ubuntu call it i386 or amd64
33+
arch <- switch(unname(Sys.info()["machine"]), "i686"="i386", "x86_64"="amd64")
34+
35+
## filename of pre-built
36+
debfile <- file.path(system.file("unitTests/bin", package="Rcpp"),
37+
arch,
38+
paste0(pkg, "_0.1.0-1_", arch, ".deb"))
39+
40+
if (file.exists(debfile)) {
41+
system(paste("sudo dpkg -i", debfile))
42+
43+
## R> testRcppPackage:::rcpp_hello_world()
44+
## [[1]]
45+
## [1] "foo" "bar"
46+
47+
## [[2]]
48+
## [1] 0 1
49+
50+
## R>
51+
52+
res <- testRcppPackage:::rcpp_hello_world()
53+
checkEquals(res, list(c("foo", "bar"), c(0.0, 1.0)),
54+
msg = "code from binary package")
55+
56+
system(paste("sudo dpkg --purge", pkg))
57+
}
58+
}
59+
}
60+
61+
572 Bytes
Binary file not shown.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Format: 1.0
2+
Source: r-cran-testrcpppackage
3+
Binary: r-cran-testrcpppackage
4+
Architecture: any
5+
Version: 0.1.0-1
6+
Maintainer: Dirk Eddelbuettel <edd@debian.org>
7+
Standards-Version: 3.9.6
8+
Build-Depends: debhelper (>= 7.0.0), r-base-dev (>= 3.1.1), cdbs
9+
Package-List:
10+
r-cran-testrcpppackage deb gnu-r optional
11+
Checksums-Sha1:
12+
4cfa8b64d4f4adc2e991ac1faae18263eb78fe07 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
13+
234e00a49064072d509cb5e6cc8e7d0bc3608245 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
14+
Checksums-Sha256:
15+
95575315827f284f5c6aacbafeba0a9609e50e312a09f7a2ff94faade83ef876 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
16+
540cc246865c5361587fa4b9cdfa604a7a2be630825bcc0b0d62cfbd7f648915 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
17+
Files:
18+
e424c851ac8f4fa40185cf4399737c7d 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
19+
54073056db0ba60cf0b1707c4b6db85c 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
Format: 1.8
2+
Date: Fri, 03 Oct 2014 08:25:46 -0500
3+
Source: r-cran-testrcpppackage
4+
Binary: r-cran-testrcpppackage
5+
Architecture: source amd64
6+
Version: 0.1.0-1
7+
Distribution: unstable
8+
Urgency: low
9+
Maintainer: Dirk Eddelbuettel <edd@debian.org>
10+
Changed-By: Dirk Eddelbuettel <edd@debian.org>
11+
Description:
12+
r-cran-testrcpppackage - GNU R package to test Rcpp during Unit Tests
13+
Changes:
14+
r-cran-testrcpppackage (0.1.0-1) unstable; urgency=low
15+
.
16+
* Initial version
17+
.
18+
* debian/control: Remove (Build-)Depends: on r-cran-rcpp as this package is
19+
internal and just used for testing from source when the packaged R binary
20+
may not be installed
21+
Checksums-Sha1:
22+
9ce17a16ee5bcd653ff1163351746ca1f0301719 619 r-cran-testrcpppackage_0.1.0-1.dsc
23+
33e5e6260dd26d4d2cd1468eea5b1e78dac154e0 2195 r-cran-testrcpppackage_0.1.0-1.tar.gz
24+
8edfa5d0ad68a9eb114e58cb0ac449a669c27edd 16266 r-cran-testrcpppackage_0.1.0-1_amd64.deb
25+
Checksums-Sha256:
26+
09bbf499ccbf68342826f9e0466e9e3259246f1c0d4b3357cf48234fef600c18 619 r-cran-testrcpppackage_0.1.0-1.dsc
27+
7cf23b12dd78667f05219b0479eb9247691495f30086622fa48536a509dc6e38 2195 r-cran-testrcpppackage_0.1.0-1.tar.gz
28+
431339b8ed1e7a7f354e70a982f64535ec75dcabe5d8b4c25161cd81bd8d7f13 16266 r-cran-testrcpppackage_0.1.0-1_amd64.deb
29+
Files:
30+
750247a57ce4e12cd37e2e57656a66f4 619 gnu-r optional r-cran-testrcpppackage_0.1.0-1.dsc
31+
80524284597233a9634a1034ccc7919c 2195 gnu-r optional r-cran-testrcpppackage_0.1.0-1.tar.gz
32+
7fb9967c5d48052f8dc6167b1ee619d3 16266 gnu-r optional r-cran-testrcpppackage_0.1.0-1_amd64.deb
15.9 KB
Binary file not shown.
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
Format: 1.8
2+
Date: Fri, 03 Oct 2014 08:25:46 -0500
3+
Source: r-cran-testrcpppackage
4+
Binary: r-cran-testrcpppackage
5+
Architecture: source i386
6+
Version: 0.1.0-1
7+
Distribution: unstable
8+
Urgency: low
9+
Maintainer: Dirk Eddelbuettel <edd@debian.org>
10+
Changed-By: Dirk Eddelbuettel <edd@debian.org>
11+
Description:
12+
r-cran-testrcpppackage - GNU R package to test Rcpp during Unit Tests
13+
Changes:
14+
r-cran-testrcpppackage (0.1.0-1) unstable; urgency=low
15+
.
16+
* Initial version
17+
.
18+
* debian/control: Remove (Build-)Depends: on r-cran-rcpp as this package is
19+
internal and just used for testing from source when the packaged R binary
20+
may not be installed
21+
Checksums-Sha1:
22+
992669d5025d83af970c60337e2d74ccf983446d 899 r-cran-testrcpppackage_0.1.0-1.dsc
23+
4cfa8b64d4f4adc2e991ac1faae18263eb78fe07 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
24+
234e00a49064072d509cb5e6cc8e7d0bc3608245 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
25+
125c9101845f6890d8e891b53aa0b69c83ccd322 16142 r-cran-testrcpppackage_0.1.0-1_i386.deb
26+
Checksums-Sha256:
27+
ca0c3050c577a61e392ceceebaffe6c6de076eb935fdea421e25341f03d9ec46 899 r-cran-testrcpppackage_0.1.0-1.dsc
28+
95575315827f284f5c6aacbafeba0a9609e50e312a09f7a2ff94faade83ef876 2171 r-cran-testrcpppackage_0.1.0.orig.tar.gz
29+
540cc246865c5361587fa4b9cdfa604a7a2be630825bcc0b0d62cfbd7f648915 572 r-cran-testrcpppackage_0.1.0-1.diff.gz
30+
924e3c73da76efe92bdc7d247f887a9fcd2b74ebdb22c67766e9669620342b17 16142 r-cran-testrcpppackage_0.1.0-1_i386.deb
31+
Files:
32+
1d2156181f8816c31306d77f4760697c 899 gnu-r optional r-cran-testrcpppackage_0.1.0-1.dsc
33+
e424c851ac8f4fa40185cf4399737c7d 2171 gnu-r optional r-cran-testrcpppackage_0.1.0.orig.tar.gz
34+
54073056db0ba60cf0b1707c4b6db85c 572 gnu-r optional r-cran-testrcpppackage_0.1.0-1.diff.gz
35+
56b8f712e86e0113715ead494065346e 16142 gnu-r optional r-cran-testrcpppackage_0.1.0-1_i386.deb
15.8 KB
Binary file not shown.

0 commit comments

Comments
 (0)