git-p4: test script
[alt-git.git] / t / t9800-git-p4.sh
blob2d354f86d04250e48c2e9fe9358282145a8c477e
1 #!/bin/sh
3 test_description='git-p4 tests'
5 . ./test-lib.sh
7 ( p4 -h && p4d -h ) >/dev/null 2>&1 || {
8 skip_all='skipping git-p4 tests; no p4 or p4d'
9 test_done
12 GITP4=$GIT_BUILD_DIR/contrib/fast-import/git-p4
13 P4DPORT=10669
15 db="$TRASH_DIRECTORY/db"
16 cli="$TRASH_DIRECTORY/cli"
17 git="$TRASH_DIRECTORY/git"
19 test_debug 'echo p4d -q -d -r "$db" -p $P4DPORT'
20 test_expect_success setup '
21 mkdir -p "$db" &&
22 p4d -q -d -r "$db" -p $P4DPORT &&
23 mkdir -p "$cli" &&
24 mkdir -p "$git" &&
25 export P4PORT=localhost:$P4DPORT
28 test_expect_success 'add p4 files' '
29 cd "$cli" &&
30 p4 client -i <<-EOF &&
31 Client: client
32 Description: client
33 Root: $cli
34 View: //depot/... //client/...
35 EOF
36 export P4CLIENT=client &&
37 echo file1 >file1 &&
38 p4 add file1 &&
39 p4 submit -d "file1" &&
40 cd "$TRASH_DIRECTORY"
43 test_expect_success 'basic git-p4 clone' '
44 "$GITP4" clone --dest="$git" //depot &&
45 rm -rf "$git" && mkdir "$git"
48 test_expect_success 'shutdown' '
49 pid=`pgrep -f p4d` &&
50 test -n "$pid" &&
51 test_debug "ps wl `echo $pid`" &&
52 kill $pid
55 test_done