Skip to content

Commit 4395a00

Browse files
committed
Merge branch 'ps/meson-tap-parse' into seen
* ps/meson-tap-parse: meson: parse TAP output generated by our tests meson: introduce kwargs variable for tests t/test-lib: don't print shell traces to stdout t: fix cases where output breaks TAP format
2 parents 8363e8a + c3207bc commit 4395a00

11 files changed

+51
-36
lines changed

contrib/credential/netrc/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,6 @@ if get_option('tests')
1717
workdir: meson.current_source_dir(),
1818
env: credential_netrc_testenv,
1919
depends: test_dependencies + bin_wrappers + [credential_netrc],
20-
timeout: 0,
20+
kwargs: test_kwargs,
2121
)
2222
endif

contrib/subtree/meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ if get_option('tests')
2121
env: subtree_test_environment,
2222
workdir: meson.current_source_dir() / 't',
2323
depends: test_dependencies + bin_wrappers + [ git_subtree ],
24-
timeout: 0,
24+
kwargs: test_kwargs,
2525
)
2626
endif
2727

meson.build

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2054,6 +2054,18 @@ subdir('templates')
20542054
# can properly set up test dependencies. The bin-wrappers themselves are set up
20552055
# at configuration time, so these are fine.
20562056
if get_option('tests')
2057+
test_kwargs = {
2058+
'timeout': 0,
2059+
}
2060+
2061+
# The TAP protocol was already understood by previous versions of Meson, but
2062+
# it was incompatible with the `meson test --interactive` flag.
2063+
if meson.version().version_compare('>=1.8.0')
2064+
test_kwargs += {
2065+
'protocol': 'tap',
2066+
}
2067+
endif
2068+
20572069
subdir('t')
20582070
endif
20592071

t/meson.build

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ clar_unit_tests = executable('unit-tests',
5252
sources: clar_sources + clar_test_suites,
5353
dependencies: [libgit_commonmain],
5454
)
55-
test('unit-tests', clar_unit_tests)
55+
test('unit-tests', clar_unit_tests, kwargs: test_kwargs)
5656

5757
unit_test_programs = [
5858
'unit-tests/t-reftable-basics.c',
@@ -77,7 +77,7 @@ foreach unit_test_program : unit_test_programs
7777
)
7878
test(unit_test_name, unit_test,
7979
workdir: meson.current_source_dir(),
80-
timeout: 0,
80+
kwargs: test_kwargs,
8181
)
8282
endforeach
8383

@@ -1210,7 +1210,7 @@ foreach integration_test : integration_tests
12101210
workdir: meson.current_source_dir(),
12111211
env: test_environment,
12121212
depends: test_dependencies + bin_wrappers,
1213-
timeout: 0,
1213+
kwargs: test_kwargs,
12141214
)
12151215
endforeach
12161216

t/t0000-basic.sh

Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -219,41 +219,44 @@ test_expect_success 'subtest: --verbose option' '
219219
test_expect_success "failing test" false
220220
test_done
221221
EOF
222-
mv t1234-verbose/out t1234-verbose/out+ &&
223-
grep -v "^Initialized empty" t1234-verbose/out+ >t1234-verbose/out &&
224-
check_sub_test_lib_test t1234-verbose <<-\EOF
225-
> expecting success of 1234.1 '\''passing test'\'': true
222+
mv t1234-verbose/err t1234-verbose/err+ &&
223+
grep -v "^Initialized empty" t1234-verbose/err+ >t1234-verbose/err &&
224+
check_sub_test_lib_test_err t1234-verbose \
225+
<<-\EOF_OUT 3<<-\EOF_ERR
226226
> ok 1 - passing test
227+
> ok 2 - test with output
228+
> not ok 3 - failing test
229+
> # false
230+
> # failed 1 among 3 test(s)
231+
> 1..3
232+
EOF_OUT
233+
> expecting success of 1234.1 '\''passing test'\'': true
227234
> Z
228235
> expecting success of 1234.2 '\''test with output'\'': echo foo
229236
> foo
230-
> ok 2 - test with output
231237
> Z
232238
> expecting success of 1234.3 '\''failing test'\'': false
233-
> not ok 3 - failing test
234-
> # false
235239
> Z
236-
> # failed 1 among 3 test(s)
237-
> 1..3
238-
EOF
240+
EOF_ERR
239241
'
240242

241243
test_expect_success 'subtest: --verbose-only option' '
242244
run_sub_test_lib_test_err \
243245
t1234-verbose \
244246
--verbose-only=2 &&
245-
check_sub_test_lib_test t1234-verbose <<-\EOF
247+
check_sub_test_lib_test_err t1234-verbose <<-\EOF_OUT 3<<-\EOF_ERR
246248
> ok 1 - passing test
247-
> Z
248-
> expecting success of 1234.2 '\''test with output'\'': echo foo
249-
> foo
250249
> ok 2 - test with output
251-
> Z
252250
> not ok 3 - failing test
253251
> # false
254252
> # failed 1 among 3 test(s)
255253
> 1..3
256-
EOF
254+
EOF_OUT
255+
> Z
256+
> expecting success of 1234.2 '\''test with output'\'': echo foo
257+
> foo
258+
> Z
259+
EOF_ERR
257260
'
258261

259262
test_expect_success 'subtest: skip one with GIT_SKIP_TESTS' '

t/t1007-hash-object.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ setup_repo() {
3030

3131
test_repo=test
3232
push_repo() {
33-
test_create_repo $test_repo
33+
test_create_repo $test_repo >/dev/null
3434
cd $test_repo
3535

3636
setup_repo

t/t4041-diff-submodule-option.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ commit_file () {
4848
git commit "$@" -m "Commit $*" >/dev/null
4949
}
5050

51-
test_create_repo sm1 &&
51+
test_create_repo sm1 >/dev/null &&
5252
add_file . foo >/dev/null
5353

5454
head1=$(add_file sm1 foo1 foo2)
@@ -236,7 +236,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' '
236236
'
237237

238238
rm -f sm1 &&
239-
test_create_repo sm1 &&
239+
test_create_repo sm1 >/dev/null &&
240240
head6=$(add_file sm1 foo6 foo7)
241241
fullhead6=$(cd sm1; git rev-parse --verify HEAD)
242242
test_expect_success 'nonexistent commit' '

t/t4060-diff-submodule-option-diff-format.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -364,7 +364,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' '
364364
'
365365

366366
rm -f sm1 &&
367-
test_create_repo sm1 &&
367+
test_create_repo sm1 >/dev/null &&
368368
head6=$(add_file sm1 foo6 foo7)
369369
test_expect_success 'nonexistent commit' '
370370
git diff-index -p --submodule=diff HEAD >actual &&

t/t7401-submodule-summary.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ commit_file () {
3838
git commit "$@" -m "Commit $*" >/dev/null
3939
}
4040

41-
test_create_repo sm1 &&
41+
test_create_repo sm1 >/dev/null &&
4242
add_file . foo >/dev/null
4343

4444
head1=$(add_file sm1 foo1 foo2)
@@ -215,7 +215,7 @@ test_expect_success 'typechanged submodule(submodule->blob)' "
215215
"
216216

217217
rm -f sm1 &&
218-
test_create_repo sm1 &&
218+
test_create_repo sm1 >/dev/null &&
219219
head6=$(add_file sm1 foo6 foo7)
220220
test_expect_success 'nonexistent commit' "
221221
git submodule summary >actual &&

t/t9500-gitweb-standalone-no-errors.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -701,13 +701,13 @@ test_expect_success \
701701
# syntax highlighting
702702

703703

704-
highlight_version=$(highlight --version </dev/null 2>/dev/null)
705-
if [ $? -eq 127 ]; then
706-
say "Skipping syntax highlighting tests: 'highlight' not found"
707-
elif test -z "$highlight_version"; then
708-
say "Skipping syntax highlighting tests: incorrect 'highlight' found"
709-
else
710-
test_set_prereq HIGHLIGHT
704+
test_lazy_prereq HIGHLIGHT '
705+
highlight_version=$(highlight --version </dev/null 2>/dev/null) &&
706+
test -n "$highlight_version"
707+
'
708+
709+
if test_have_prereq HIGHLIGHT
710+
then
711711
cat >>gitweb_config.perl <<-\EOF
712712
our $highlight_bin = "highlight";
713713
$feature{'highlight'}{'override'} = 1;

0 commit comments

Comments
 (0)