#!/bin/sh # # Copyright (c) 2008 Lea Wiemann # global test_description := ''perl interface (Git.pm)'' source ./test-lib.sh if ! test_have_prereq PERL { global skip_all := ''skipping perl interface tests, perl not available'' test_done } perl -MTest::More -e 0 !2 >/dev/null || do { global skip_all := '"Perl Test::More unavailable, skipping test'" test_done } # set up test repository test_expect_success \ 'set up test repository' \ 'echo "test file 1" > file1 && echo "test file 2" > file2 && mkdir directory1 && echo "in directory1" >> directory1/file && mkdir directory2 && echo "in directory2" >> directory2/file && git add . && git commit -m "first commit" && echo "new file in subdir 2" > directory2/file2 && git add . && git commit -m "commit in directory2" && echo "changed file 1" > file1 && git commit -a -m "second commit" && git config --add color.test.slot1 green && git config --add test.string value && git config --add test.dupstring value1 && git config --add test.dupstring value2 && git config --add test.booltrue true && git config --add test.boolfalse no && git config --add test.boolother other && git config --add test.int 2k && git config --add test.path "~/foo" && git config --add test.pathexpanded "$HOME/foo" && git config --add test.pathmulti foo && git config --add test.pathmulti bar ' # The external test will outputs its own plan global test_external_has_tap := '1' test_external_without_stderr \ 'Perl API' \ perl "$TEST_DIRECTORY"/t9700/test.pl test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"perl interface (Git.pm)">)} spids: [13] ) ] spids: [13] ) (C {(.)} {(./test-lib.sh)}) (If arms: [ (if_arm cond: [ (Sentence child: (Pipeline children:[(C {(test_have_prereq)} {(PERL)})] negated:True) terminator: ) ] action: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:skip_all) op: Equal rhs: {(SQ <"skipping perl interface tests, perl not available">)} spids: [35] ) ] spids: [35] ) (C {(test_done)}) ] spids: [-1 32] ) ] spids: [-1 43] ) (AndOr children: [ (SimpleCommand words: [{(perl)} {(-MTest) (Lit_Other ":") (Lit_Other ":") (More)} {(-e)} {(0)}] redirects: [(Redir op_id:Redir_Great fd:2 arg_word:{(/dev/null)} spids:[57])] ) (BraceGroup children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:skip_all) op: Equal rhs: {(DQ ("Perl Test::More unavailable, skipping test"))} spids: [65] ) ] spids: [65] ) (C {(test_done)}) ] spids: [62] ) ] op_id: Op_DPipe ) (C {(test_expect_success)} {(SQ <"set up test repository">)} { (SQ <"echo \"test file 1\" > file1 &&\n"> <" echo \"test file 2\" > file2 &&\n"> <" mkdir directory1 &&\n"> <" echo \"in directory1\" >> directory1/file &&\n"> <" mkdir directory2 &&\n"> <" echo \"in directory2\" >> directory2/file &&\n"> <" git add . &&\n"> <" git commit -m \"first commit\" &&\n"> <"\n"> <" echo \"new file in subdir 2\" > directory2/file2 &&\n"> <" git add . &&\n"> <" git commit -m \"commit in directory2\" &&\n"> <"\n"> <" echo \"changed file 1\" > file1 &&\n"> <" git commit -a -m \"second commit\" &&\n"> <"\n"> <" git config --add color.test.slot1 green &&\n"> <" git config --add test.string value &&\n"> <" git config --add test.dupstring value1 &&\n"> <" git config --add test.dupstring value2 &&\n"> <" git config --add test.booltrue true &&\n"> <" git config --add test.boolfalse no &&\n"> <" git config --add test.boolother other &&\n"> <" git config --add test.int 2k &&\n"> <" git config --add test.path \"~/foo\" &&\n"> <" git config --add test.pathexpanded \"$HOME/foo\" &&\n"> <" git config --add test.pathmulti foo &&\n"> <" git config --add test.pathmulti bar\n"> <" "> ) } ) (Assignment keyword: Assign_None pairs: [(assign_pair lhs:(LhsName name:test_external_has_tap) op:Equal rhs:{(1)} spids:[126])] spids: [126] ) (C {(test_external_without_stderr)} {(SQ <"Perl API">)} {(perl)} {(DQ ($ VSub_Name "$TEST_DIRECTORY")) (/t9700/test.pl)} ) (C {(test_done)}) ] )