changeset 37:cf3fe04cd96b

Initial work on testing
author Marcin Kasperski <Marcin.Kasperski@mekk.waw.pl>
date Sat, 24 Sep 2016 15:51:58 +0200
parents c27e23a3509c
children f371747bb8fc
files tests/basic.t tests/config-items.t tests/facing_problems.t tests/groups-legacy.t tests/groups-modern.t
diffstat 5 files changed, 128 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/basic.t	Sat Sep 24 15:51:58 2016 +0200
@@ -0,0 +1,120 @@
+
+Let's test all_paths operations.
+
+Some locations used during testing:
+
+  $ WORK_DIR=${WORK_DIR-`pwd`/work}
+  $ rm -rf $WORK_DIR
+
+  $ export BASE=$WORK_DIR/base
+  $ export REP1=$WORK_DIR/rep1
+  $ export REP2=$WORK_DIR/rep2
+  $ export REP3=$WORK_DIR/rep3
+
+First we need appropriate Mercurial configuration file (and variable
+which ensures it is used).
+
+  $ export HGRCPATH=$WORK_DIR/hgrc
+  $ mkdir -p $HGRCPATH
+
+  $ cat > $HGRCPATH/basic.rc << EOF
+  > [ui]
+  > username = Andy Default <default@nowhere.net>
+  > [extensions]
+  > all_paths =
+  > EOF
+
+We need some repositories to test.
+
+  $ hg init "$BASE"
+  $ hg init "$REP1"
+  $ hg init "$REP2"
+  $ hg init "$REP3"
+
+  $ cat > $BASE/.hg/hgrc
+  > [paths]
+  > remote1=$REP1
+  > remote2=$REP2
+  > remote3=$REP3
+  > EOF
+
+Let's test pushing
+
+  $ echo > $BASE/file.txt
+  > Some text
+  > EOF
+
+  $ hg --cwd $BASE add
+  $ hg --cwd $BASE commit -m 'First'
+
+  $ hg --cwd $BASE pushall
+
+  $ hg --cwd $REP1 log
+
+  $ hg --cwd $REP2 log
+  
+  $ hg --cwd $REP3 log
+
+Let's also test pulling 
+
+  $ hg --cwd $REP1 update
+
+  $ echo > $REP1/rep1.txt
+  > Another text
+  > EOF
+
+  $ hg --cwd $REP1 add
+  $ hg --cwd $REP1 commit -m "In repo1"
+
+
+  $ hg --cwd $REP2 update
+
+  $ echo >> $REP2/file.txt
+  > From repo2…
+  > EOF
+
+  $ hg --cwd $REP2 add
+  $ hg --cwd $REP2 commit -m "In repo2"
+
+  $ hg --cwd $BASE incomingall
+
+  $ hg --cwd $BASE pullall
+
+  $ hg --cwd $BASE log
+
+  $ hg --cwd $BASE outgoingall
+
+Without remotes those commands do nothing
+
+  $ hg --cwd $REP3 pullall
+
+  $ hg --cwd $REP3 pushall
+
+  $ hg --cwd $REP3 incomingall
+
+  $ hg --cwd $REP3 outgoingall
+
+Finally let's test that push options work
+
+  $ echo > $BASE/br1.txt
+  > Br1 text
+  > EOF
+
+  $ hg --cwd $BASE branch br1
+  $ hg --cwd $BASE add
+  $ hg --cwd $BASE commit -m 'Br1'
+
+  $ hg --cwd $BASE update default
+  $ echo >> $BASE/file.txt
+  > later text
+  > EOF
+  $ hg --cwd $BASE commit -m 'Normal''
+ 
+  $ hg --cwd $BASE pushall -r default -f
+
+  $ hg --cwd $REP1 log
+
+  $ hg --cwd $REP2 log
+  
+  $ hg --cwd $REP3 log
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/config-items.t	Sat Sep 24 15:51:58 2016 +0200
@@ -0,0 +1,2 @@
+
+TODO: testing priorities and skips
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/facing_problems.t	Sat Sep 24 15:51:58 2016 +0200
@@ -0,0 +1,2 @@
+
+TODO: test when some repo raises errors (is missing, unrelated etc)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/groups-legacy.t	Sat Sep 24 15:51:58 2016 +0200
@@ -0,0 +1,2 @@
+
+TODO: testing legacy group syntax
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/tests/groups-modern.t	Sat Sep 24 15:51:58 2016 +0200
@@ -0,0 +1,2 @@
+
+TODO: testing newer group syntax
\ No newline at end of file