3 # Copyright (c) 2008 Sverre Rabbelier
6 test_description
='stats tests (basics)
8 This test verifies that the basic stats commands work as expected.'
20 test_expect_success pre-clean
'
21 rm -fr "/tmp/freshrepo" || {
23 echo >&5 "FATAL: Cannot clean the fresh repo"
28 test_expect_success setup
'
29 ../../scripts/setupRepo.py
32 test_must_fail stats.py
35 test_expect_success
'Verify that the expected tree was created' '
36 test `git rev-parse HEAD` = "72224f7dd1549afc56a33851afa32d70144ced4b"
46 echo "notes.txt = 3: +3 -0"
47 echo "content.txt = 23: +23 -1"
50 test_expect_success
'Verify that author filters the result properly' '
51 stats.py author -d "author@example.com" > actual
52 test_cmp expected actual
56 echo "content.txt = 2: +2 -0"
59 test_expect_success
'Verify that the secondary authors result is filtered properly' '
60 stats.py author -d "roh.tua@example.com" > actual
61 test_cmp expected actual
64 test_expect_failure
'Verify that the output for authors is aggregated properly' '
65 test `stats.py author -a` != ""
73 echo "Matching branches:"
77 test_expect_success
'Test that the branch filter works as expected' '
78 stats.py branch -c 6f01ab2afb8471d6eee83162ddeabe179e443d59 > actual
79 test_cmp expected actual
83 echo "Matching branches:"
89 'Test that the branch filter works when multiple branches match' \
91 stats.py branch -c c0e49264fd921d2a62f90556340e371e719b45cc > actual
92 test_cmp expected actual
95 test_expect_failure
'Test that there is a test for the -r switch' '
104 test_expect_success
'Teardown' '