aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndré Erdmann <dywi@mailerd.de>2013-07-03 12:04:19 +0200
committerAndré Erdmann <dywi@mailerd.de>2013-07-03 12:04:19 +0200
commit3585d9bf76990672a2fb2f75ac694ffe8345de0d (patch)
treeed435f8a04af4d6ec62ef3ff23c9f7da7bc62556 /tests
parentroverlay/depres: restrict calculated slot value (diff)
downloadR_overlay-3585d9bf76990672a2fb2f75ac694ffe8345de0d.tar.gz
R_overlay-3585d9bf76990672a2fb2f75ac694ffe8345de0d.tar.bz2
R_overlay-3585d9bf76990672a2fb2f75ac694ffe8345de0d.zip
tests/static/depres: add examples from doc/rst
Diffstat (limited to 'tests')
-rw-r--r--tests/static/depres.py121
1 files changed, 120 insertions, 1 deletions
diff --git a/tests/static/depres.py b/tests/static/depres.py
index f72d3dd..873237e 100644
--- a/tests/static/depres.py
+++ b/tests/static/depres.py
@@ -6,6 +6,9 @@
# ready-to-use input for testing dependency resolution
+EMPTY_STR = ""
+
+RESOLVE_AS_IGNORED = lambda s: ( s, EMPTY_STR )
DONT_RESOLVE = lambda s: ( s, None )
DONT_RESOLVE_TUPLE = lambda *S: tuple ( map ( DONT_RESOLVE, S ) )
@@ -17,6 +20,7 @@ DEPRES_DATA = {
( "fftw 2", ">=sci-libs/fftw-2" ),
( "fftw 2.1.5", ">=sci-libs/fftw-2.1.5:2.1" ),
),
+
'slot0': (
( "p0", "cat/pkg:*" ),
DONT_RESOLVE ( "p0 !=2" ),
@@ -31,8 +35,88 @@ DEPRES_DATA = {
DONT_RESOLVE ( "p3 1." ),
( "p3 2.1.0", "cat/pkg:1" ),
( "p4 5.4.3.2.1", "cat/pkg:5=" ),
+ ( "p5 4", "cat/pkg:99/2" ),
),
+
'empty': DONT_RESOLVE_TUPLE ( "fftw", ),
+
+ # examples from doc/rst/usage.rst
+ 'example1': (
+ ( "r 2.12", ">=dev-lang/R-2.12" ),
+ ( "R(>= 2.14)", ">=dev-lang/R-2.14" ),
+ ( "R [<2.10]", "<dev-lang/R-2.10" ),
+ ( "r{ !=2.12 }", "( !=dev-lang/R-2.12 dev-lang/R )" ),
+ ( "R", "dev-lang/R" ),
+ DONT_RESOLVE ( "R (!2)" ),
+ ),
+ 'example2': (
+ # depends on DEFAULT_CATEGORY
+ ( 'zoo', 'sci-R/zoo' ),
+ DONT_RESOLVE ( 'zoo 5' ),
+ ),
+ 'example3': (
+ (
+ 'for building from source: GDAL >= 1.3.1 && GDAL < 1.6.0 '
+ '(until tested) library and PROJ.4 (proj >= 4.4.9)',
+ '( sci-libs/gdal sci-libs/proj )'
+ ),
+ (
+ 'for building from source: GDAL >= 1.3.1 library '
+ 'and PROJ.4 (proj >= 4.4.9)',
+ '( sci-libs/gdal sci-libs/proj )'
+ ),
+ (
+ 'for building from source: GDAL >= 1.3.1 library '
+ 'and PROJ.4(proj >= 4.4.9)',
+ '( sci-libs/gdal sci-libs/proj )'
+ ),
+ (
+ 'for building from source: GDAL >= 1.6.0 library '
+ 'and PROJ.4(proj >= 4.4.9)',
+ '( sci-libs/gdal sci-libs/proj )'
+ ),
+ DONT_RESOLVE ( "for building from source: GDAL AND PROJ" ),
+ ),
+ 'example4': (
+ RESOLVE_AS_IGNORED ( "see README" ),
+ RESOLVE_AS_IGNORED ( "read INSTALL" ),
+ RESOLVE_AS_IGNORED (
+ "Will use djmrgl or rgl packages for rendering if present"
+ ),
+ ),
+ 'example5': (
+ ( "fftw", "sci-libs/fftw" ),
+ DONT_RESOLVE ( "fftw 2" ),
+ ( "fftw 2.1", "sci-libs/fftw:2.1" ),
+ ( "fftw 2.1.2", "sci-libs/fftw:2.1" ),
+ ( "fftw 2.1.3", "sci-libs/fftw:2.1" ),
+ ( "fftw [ <=2.2]", "sci-libs/fftw:2.2" ),
+ ( "fftw (=3.0)", "sci-libs/fftw:3.0" ),
+ # !!
+ ( "fftw (=3.2)", "sci-libs/fftw:3.2" ),
+ DONT_RESOLVE ( "fftw ( != 5 )" ),
+ ),
+ 'example6': (
+ ( "fftw", "sci-libs/fftw" ),
+ DONT_RESOLVE ( "fftw 2" ),
+ ( "fftw 2.1", "sci-libs/fftw:2.1" ),
+ ( "fftw 2.1.2", "sci-libs/fftw:2.1" ),
+ ( "fftw 2.1.3", "sci-libs/fftw:2.1" ),
+ DONT_RESOLVE ( "fftw [ <=2.2]" ),
+ ( "fftw (=3.0)", "sci-libs/fftw:3.0" ),
+ # !!
+ DONT_RESOLVE ( "fftw (=3.2)" ),
+ DONT_RESOLVE ( "fftw ( != 5 )" ),
+ ),
+ 'example5+6' : 'example5',
+ 'example7': (
+ DONT_RESOLVE ( "fftw (=2.1)" ),
+ ( "fftw (=3.0)", "sci-libs/fftw:3.0" ),
+ ( "fftw (=3.1)", "sci-libs/fftw:3.0" ),
+ ( "fftw (=3.2)", "sci-libs/fftw:3.0" ),
+ ( "fftw (=3.3)", "sci-libs/fftw:3.0" ),
+ ),
+
}
# dict <ruleset name>, <m-tuples>( <rule file line>^m )
@@ -42,20 +126,55 @@ DEPRES_RULES = {
'~sci-libs/fftw:+v:s=..1 :: fftw',
'~sci-libs/fftw :: fftw',
),
+
'slot0': (
'~cat/pkg:open:* :: p0',
'~cat/pkg:open: :: p1',
'~cat/pkg:with_version:s=..1:/2 :: p2',
'~cat/pkg:s=1 :: p3',
'~cat/pkg:= :: p4',
+ '~cat/pkg:s=i99:/i2 :: p5',
),
+
'empty': (),
+
+ # examples from doc/rst/usage.rst
+ 'example1': (
+ '~dev-lang/R :: R',
+ ),
+ 'example2': (
+ 'zoo',
+ ),
+ 'example3': (
+ '( sci-libs/gdal sci-libs/proj ) {',
+ 'for building from source: GDAL >= 1.3.1 && GDAL < 1.6.0 (until tested) library and PROJ.4 (proj >= 4.4.9)',
+ 'for building from source: GDAL >= 1.3.1 library and PROJ.4 (proj >= 4.4.9)',
+ 'for building from source: GDAL >= 1.3.1 library and PROJ.4(proj >= 4.4.9)',
+ 'for building from source: GDAL >= 1.6.0 library and PROJ.4(proj >= 4.4.9)',
+ '}',
+ ),
+ 'example4': (
+ '! {',
+ 'see README',
+ 'read INSTALL',
+ 'Will use djmrgl or rgl packages for rendering if present',
+ '}',
+ ),
+ 'example5': (
+ '~sci-libs/fftw:s=0..1 :: fftw',
+ ),
+ 'example6': (
+ '~sci-libs/fftw:s=0..1:restrict=2.1,3.0: :: fftw',
+ ),
+ 'example7': (
+ '~sci-libs/fftw:s=i3.0:r=3.0,3.1,3.2,3.3 :: fftw',
+ ),
}
# dict <dataset name>, <iterable|str <ruleset name(s)>>
# datasets not listed here default to <dataset name> as <ruleset name>
DEPRES_INCLUDE = {
- #"fftw": "fftw",
+ 'example5+6': ( "example5", "example6", ),
}
#DEPRES_FAULTY_RULES=...