mirror of
https://github.com/git/git.git
synced 2024-12-12 11:24:02 +08:00
63ee933383
All the Perforce tests are free of memory leaks. This went unnoticed because most folks do not have p4 and p4d installed on their computers. Consequently, given that the prerequisites for running those tests aren't fulfilled, `TEST_PASSES_SANITIZE_LEAK=check` won't notice that those tests are indeed memory leak free. Mark those tests accordingly. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
97 lines
1.8 KiB
Bash
Executable File
97 lines
1.8 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
test_description='git p4 retrieve job info'
|
|
|
|
TEST_PASSES_SANITIZE_LEAK=true
|
|
. ./lib-git-p4.sh
|
|
|
|
test_expect_success 'start p4d' '
|
|
start_p4d
|
|
'
|
|
|
|
test_expect_success 'add p4 jobs' '
|
|
(
|
|
p4_add_job TESTJOB-A &&
|
|
p4_add_job TESTJOB-B
|
|
)
|
|
'
|
|
|
|
test_expect_success 'add p4 files' '
|
|
client_view "//depot/... //client/..." &&
|
|
(
|
|
cd "$cli" &&
|
|
>file1 &&
|
|
p4 add file1 &&
|
|
p4 submit -d "Add file 1"
|
|
)
|
|
'
|
|
|
|
test_expect_success 'check log message of changelist with no jobs' '
|
|
client_view "//depot/... //client/..." &&
|
|
test_when_finished cleanup_git &&
|
|
(
|
|
cd "$git" &&
|
|
git init . &&
|
|
git p4 clone --use-client-spec --destination="$git" //depot@all &&
|
|
cat >expect <<-\EOF &&
|
|
Add file 1
|
|
[git-p4: depot-paths = "//depot/": change = 1]
|
|
|
|
EOF
|
|
git log --format=%B >actual &&
|
|
test_cmp expect actual
|
|
)
|
|
'
|
|
|
|
test_expect_success 'add TESTJOB-A to change 1' '
|
|
(
|
|
cd "$cli" &&
|
|
p4 fix -c 1 TESTJOB-A
|
|
)
|
|
'
|
|
|
|
test_expect_success 'check log message of changelist with one job' '
|
|
client_view "//depot/... //client/..." &&
|
|
test_when_finished cleanup_git &&
|
|
(
|
|
cd "$git" &&
|
|
git init . &&
|
|
git p4 clone --use-client-spec --destination="$git" //depot@all &&
|
|
cat >expect <<-\EOF &&
|
|
Add file 1
|
|
Jobs: TESTJOB-A
|
|
[git-p4: depot-paths = "//depot/": change = 1]
|
|
|
|
EOF
|
|
git log --format=%B >actual &&
|
|
test_cmp expect actual
|
|
)
|
|
'
|
|
|
|
test_expect_success 'add TESTJOB-B to change 1' '
|
|
(
|
|
cd "$cli" &&
|
|
p4 fix -c 1 TESTJOB-B
|
|
)
|
|
'
|
|
|
|
test_expect_success 'check log message of changelist with more jobs' '
|
|
client_view "//depot/... //client/..." &&
|
|
test_when_finished cleanup_git &&
|
|
(
|
|
cd "$git" &&
|
|
git init . &&
|
|
git p4 clone --use-client-spec --destination="$git" //depot@all &&
|
|
cat >expect <<-\EOF &&
|
|
Add file 1
|
|
Jobs: TESTJOB-A TESTJOB-B
|
|
[git-p4: depot-paths = "//depot/": change = 1]
|
|
|
|
EOF
|
|
git log --format=%B >actual &&
|
|
test_cmp expect actual
|
|
)
|
|
'
|
|
|
|
test_done
|