# HG changeset patch # User Marcin Kasperski # Date 1474752709 -7200 # Node ID a1fb32ff453292c47c2a7374f8ee9ef887ad149f # Parent 7b4bc975644c6ad37e87946a1f259197c32330bd Further work on tests diff -r 7b4bc975644c -r a1fb32ff4532 tests/config-items.t --- a/tests/config-items.t Sat Sep 24 23:19:27 2016 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2 +0,0 @@ - -TODO: testing priorities and skips \ No newline at end of file diff -r 7b4bc975644c -r a1fb32ff4532 tests/facing_problems.t --- a/tests/facing_problems.t Sat Sep 24 23:19:27 2016 +0200 +++ b/tests/facing_problems.t Sat Sep 24 23:31:49 2016 +0200 @@ -1,2 +1,129 @@ -TODO: test when some repo raises errors (is missing, unrelated etc) \ No newline at end of file +Let's test behaviour when there are problems - some repo is missing, +another is unrelated. + +Some locations used during testing: + + $ WORK_DIR=${WORK_DIR-`pwd`/work} + $ rm -rf $WORK_DIR + + $ export BASE=$WORK_DIR/base + $ export GOOD1=$WORK_DIR/good1 + $ export UNREL=$WORK_DIR/unrelated + $ export MISSING=$WORK_DIR/missing + $ export GOOD2=$WORK_DIR/good2 + +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 + > [extensions] + > mercurial_all_paths = + > EOF + +We need some repositories to test. + + $ hg init "$BASE" + $ hg init "$GOOD1" + $ hg init "$UNREL" + $ hg init "$GOOD2" + + $ cat > $BASE/.hg/hgrc << EOF + > [paths] + > good1=$GOOD1 + > unrel=$UNREL + > missing=$MISSING + > good2=$GOOD2 + > EOF + + $ cat > $UNREL/something.txt << EOF + > This gonnna be unrelated. + > EOF + $ hg --cwd $UNREL add + adding something.txt + $ hg --cwd $UNREL commit -m "Unrelated" + +Let's test pushing + + $ cat > $BASE/file.txt << EOF + > Some text + > EOF + $ hg --cwd $BASE add + adding file.txt + $ hg --cwd $BASE commit -m 'First' + + $ hg --cwd $BASE pushall + pushing to */good1 (glob) + searching for changes + adding changesets + adding manifests + adding file changes + added 1 changesets with 1 changes to 1 files + pushing to */unrelated (glob) + searching for changes + abort: repository is unrelated + [255] + + $ hg --cwd $GOOD1 log -T '{rev}: {desc}\n' + 0: First + + $ hg --cwd $GOOD2 log -T '{rev}: {desc}\n' + 0: First + + $ hg --cwd $UNREL log -T '{rev}: {desc}\n' + 0: Unrelated + +Let's also test pulling + + $ hg --cwd $GOOD1 update + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cat > $GOOD1/rep1.txt << EOF + > Another text + > EOF + $ hg --cwd $GOOD1 add + adding rep1.txt + $ hg --cwd $GOOD1 commit -m "In repo1" + + $ hg --cwd $UNREL update + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cat > $UNREL/unr.txt << EOF + > Another text + > EOF + $ hg --cwd $UNREL add + adding unr.txt + $ hg --cwd $UNREL commit -m "In unrel" + + $ hg --cwd $GOOD2 update + 1 files updated, 0 files merged, 0 files removed, 0 files unresolved + $ cat > $GOOD2/rep1.txt << EOF + > Another text + > EOF + $ hg --cwd $GOOD2 add + adding rep1.txt + $ hg --cwd $GOOD2 commit -m "In good2" + + $ hg --cwd $BASE incomingall + comparing with */rep1 (glob) + searching for changes + changeset: 1:* (glob) + tag: tip + user: Andy Default + date: .* (re) + summary: In repo1 + + comparing with */rep2 (glob) + searching for changes + changeset: 1:* (glob) + tag: tip + user: Andy Default + date: .* (re) + summary: In repo2 + + $ hg --cwd $BASE pullall + + $ hg --cwd $BASE log -T '{rev}: {desc}\n' diff -r 7b4bc975644c -r a1fb32ff4532 tests/ignore_and_prioritize.t --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/tests/ignore_and_prioritize.t Sat Sep 24 23:31:49 2016 +0200 @@ -0,0 +1,2 @@ + +TODO: testing priorities and skips \ No newline at end of file