| 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2008 Lea Wiemann |
| 4 | # |
| 5 | |
| 6 | test_description='perl interface (Git.pm)' |
| 7 | |
| 8 | . ./test-lib.sh |
| 9 | . "$TEST_DIRECTORY"/lib-perl.sh |
| 10 | |
| 11 | skip_all_if_no_Test_More |
| 12 | |
| 13 | # set up test repository |
| 14 | |
| 15 | test_expect_success 'set up test repository' ' |
| 16 | echo "test file 1" >file1 && |
| 17 | echo "test file 2" >file2 && |
| 18 | mkdir directory1 && |
| 19 | echo "in directory1" >>directory1/file && |
| 20 | mkdir directory2 && |
| 21 | echo "in directory2" >>directory2/file && |
| 22 | git add . && |
| 23 | git commit -m "first commit" && |
| 24 | |
| 25 | echo "new file in subdir 2" >directory2/file2 && |
| 26 | git add . && |
| 27 | git commit -m "commit in directory2" && |
| 28 | |
| 29 | echo "changed file 1" >file1 && |
| 30 | git commit -a -m "second commit" && |
| 31 | |
| 32 | git config --add color.test.slot1 green && |
| 33 | git config --add test.string value && |
| 34 | git config --add test.dupstring value1 && |
| 35 | git config --add test.dupstring value2 && |
| 36 | git config --add test.booltrue true && |
| 37 | git config --add test.boolfalse no && |
| 38 | git config --add test.boolother other && |
| 39 | git config --add test.int 2k && |
| 40 | git config --add test.path "~/foo" && |
| 41 | git config --add test.pathexpanded "$HOME/foo" && |
| 42 | git config --add test.pathmulti foo && |
| 43 | git config --add test.pathmulti bar |
| 44 | ' |
| 45 | |
| 46 | test_expect_success 'set up bare repository' ' |
| 47 | git init --bare bare.git && |
| 48 | git -C bare.git --work-tree=. commit --allow-empty -m "bare commit" |
| 49 | ' |
| 50 | |
| 51 | test_expect_success 'use t9700/test.pl to test Git.pm' ' |
| 52 | "$PERL_PATH" "$TEST_DIRECTORY"/t9700/test.pl 2>stderr && |
| 53 | test_must_be_empty stderr |
| 54 | ' |
| 55 | |
| 56 | test_done |