From: Tara L Andrews Date: Fri, 14 Sep 2012 12:05:21 +0000 (+0200) Subject: make test DB generation script work with new world order X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=6795f2701800be5baf9a260ee38ce4f4a1c1c2d6;p=scpubgit%2Fstemmatology.git make test DB generation script work with new world order --- diff --git a/base/script/maketestdb.sh b/base/script/maketestdb.sh index 744c563..b27b10e 100755 --- a/base/script/maketestdb.sh +++ b/base/script/maketestdb.sh @@ -1,9 +1,12 @@ #!/bin/bash -( cd stemmaweb/db && rm -f traditions.db.test && rm -f traditions.db && ln -s traditions.db.test traditions.db ) -script/make_tradition.pl -i self -o db -s t/data/florilegium.dot t/data/florilegium_graphml.xml -script/make_tradition.pl -i self -o db --dbid 'tradition:notre_besoin' -s t/data/besoin.dot t/data/besoin.xml -script/admin_users.pl -u 'admin@example.org' -p 'AdminPass' -r 'admin' -script/admin_users.pl -u 'user@example.org' -p 'UserPass' -script/admin_users.pl -c modify -u 'user@example.org' -t 'tradition:notre_besoin' +DBDIR=$1 +DSN=dbi:SQLite:dbname=$DBDIR/traditions.db + +( cd $DBDIR && rm -f traditions.db.test && rm -f traditions.db && ln -s traditions.db.test traditions.db ) +script/make_tradition.pl -i self -o db --dsn $DSN -s t/data/florilegium.dot t/data/florilegium_graphml.xml +script/make_tradition.pl -i self -o db --dsn $DSN --dbid 'tradition:notre_besoin' -s t/data/besoin.dot t/data/besoin.xml +script/admin_users.pl --dsn $DSN -u 'admin@example.org' -p 'AdminPass' -r 'admin' +script/admin_users.pl --dsn $DSN -u 'user@example.org' -p 'UserPass' +script/admin_users.pl --dsn $DSN -c modify -u 'user@example.org' -t 'tradition:notre_besoin' diff --git a/base/t/data/besoin.dot b/base/t/data/besoin.dot new file mode 100644 index 0000000..3843c05 --- /dev/null +++ b/base/t/data/besoin.dot @@ -0,0 +1,30 @@ +digraph Stemma { + omega [ class=hypothetical ]; + T1 [ class=extant ]; + T2 [ class=extant ]; + A [ class=extant ]; + B [ class=extant ]; + C [ class=extant ]; + D [ class=extant ]; + F [ class=extant ]; + J [ class=extant ]; + L [ class=extant ]; + M [ class=extant ]; + S [ class=extant ]; + U [ class=extant ]; + V [ class=extant ]; + T1 -> T2; + T2 -> A; + A -> J; + A -> C; + C -> M; + C -> F; + C -> S; + S -> D; + A -> U; + U -> F; + U -> V; + U -> omega; + omega -> B; + B -> L; +}