Skip to content

Commit

Permalink
Merge pull request #4101 from masatake/meson--benchmark
Browse files Browse the repository at this point in the history
Meson: extract benchmark langage objects correctly
  • Loading branch information
masatake authored Oct 25, 2024
2 parents 7510053 + e41c5a8 commit f3f720e
Show file tree
Hide file tree
Showing 6 changed files with 49 additions and 7 deletions.
2 changes: 0 additions & 2 deletions Units/parser-meson.r/simple-meson.d/README

This file was deleted.

12 changes: 12 additions & 0 deletions Units/parser-meson.r/simple-meson.d/expected.tags
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,15 @@ outfile input-3.meson /^outfile = 'output.bin'$/;" variable
mytarget input-3.meson /^mytarget = custom_target('targetname',$/;" variable
targetname input-3.meson /^mytarget = custom_target('targetname',$/;" custom
inspector input-4.meson /^run_target('inspector',$/;" run
test_kwargs input-5.meson /^test_kwargs = {$/;" variable
bench_connect input-5.meson /^bench_connect = executable('bench-connect', sources: ['bench-connect.c'], kwargs: test_kwargs)$/;" variable
bench-connect input-5.meson /^bench_connect = executable('bench-connect', sources: ['bench-connect.c'], kwargs: test_kwargs)$/;" build
bench_message input-5.meson /^bench_message = executable('bench-message', sources: ['bench-message.c'], kwargs: test_kwargs)$/;" variable
bench-message input-5.meson /^bench_message = executable('bench-message', sources: ['bench-message.c'], kwargs: test_kwargs)$/;" build
suites input-5.meson /^suites = [$/;" variable
Connection input-5.meson /^ benchmark('Connection', bench_connect, timeout: 60, kwargs: suite)$/;" benchmark
Message passing input-5.meson /^ benchmark('Message passing', bench_message, timeout: 120, kwargs: suite)$/;" benchmark
gi_docgen input-6.meson /^gi_docgen = find_program('gi-docgen')$/;" variable
gck input-6.meson /^subdir('gck')$/;" subdir
gcr input-6.meson /^subdir('gcr')$/;" subdir
docs input-6.meson /^alias_target('docs',$/;" run
19 changes: 19 additions & 0 deletions Units/parser-meson.r/simple-meson.d/input-5.meson
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# -*- Meson -*-
# Derrived from test/dbus/meson.build of dbus-broker
test_kwargs = {
'dependencies': [dep_test],
'install': use_tests,
'install_dir': conf.get('testdir') / 'dbus',
}

bench_connect = executable('bench-connect', sources: ['bench-connect.c'], kwargs: test_kwargs)
bench_message = executable('bench-message', sources: ['bench-message.c'], kwargs: test_kwargs)

suites = [
{ 'suite': 'dbus-broker', 'env': ['DBUS_BROKER_TEST_BROKER=' + exe_dbus_broker.full_path()]},
]

foreach suite : suites
benchmark('Connection', bench_connect, timeout: 60, kwargs: suite)
benchmark('Message passing', bench_message, timeout: 120, kwargs: suite)
endforeach
13 changes: 13 additions & 0 deletions Units/parser-meson.r/simple-meson.d/input-6.meson
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# -*- Meson -*-
# Taken from docs/meson.build of gcr
#
gi_docgen = find_program('gi-docgen')

subdir('gck')
subdir('gcr')

# Create a pseudo target that build all docs at once
alias_target('docs',
gck_docs,
gcr_docs,
)
8 changes: 4 additions & 4 deletions optlib/meson.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static void initializeMesonParser (const langType language)
"^(alias|run)_target[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\2", "r", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "main",
"^bench_mark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"^benchmark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\1", "b", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "main",
"^import[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
Expand Down Expand Up @@ -113,7 +113,7 @@ static void initializeMesonParser (const langType language)
"^(alias|run)_target[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\2", "r", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "skipPair",
"^bench_mark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"^benchmark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\1", "b", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "skipPair",
"^import[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
Expand Down Expand Up @@ -149,7 +149,7 @@ static void initializeMesonParser (const langType language)
"^(alias|run)_target[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\2", "r", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "common",
"^bench_mark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"^benchmark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\1", "b", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "common",
"^import[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
Expand Down Expand Up @@ -179,7 +179,7 @@ static void initializeMesonParser (const langType language)
"^(alias|run)_target[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\2", "r", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "skipToArgEnd",
"^bench_mark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"^benchmark[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
"\\1", "b", "{tenter=skipToArgEnd}", NULL);
addLanguageTagMultiTableRegex (language, "skipToArgEnd",
"^import[ \t\n]*\\([ \t\n]*'([^']*[^\\\\])'[ \t\n]*",
Expand Down
2 changes: 1 addition & 1 deletion optlib/meson.ctags
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
--_mtable-regex-Meson=common/(jar|executable|shared_module|(both_|shared_|static_)?library)[ \t\n]*\([ \t\n]*'([^']*[^\\])'[ \t\n]*/\3/B/{tenter=skipToArgEnd}
--_mtable-regex-Meson=common/custom_target[ \t\n]*\([ \t\n]*'([^']*[^\\])'[ \t\n]*/\1/c/{tenter=skipToArgEnd}
--_mtable-regex-Meson=common/(alias|run)_target[ \t\n]*\([ \t\n]*'([^']*[^\\])'[ \t\n]*/\2/r/{tenter=skipToArgEnd}
--_mtable-regex-Meson=common/bench_mark[ \t\n]*\([ \t\n]*'([^']*[^\\])'[ \t\n]*/\1/b/{tenter=skipToArgEnd}
--_mtable-regex-Meson=common/benchmark[ \t\n]*\([ \t\n]*'([^']*[^\\])'[ \t\n]*/\1/b/{tenter=skipToArgEnd}
--_mtable-regex-Meson=common/import[ \t\n]*\([ \t\n]*'([^']*[^\\])'[ \t\n]*/\1/m/{tenter=skipToArgEnd}{_role=imported}

--_mtable-extend-Meson=skipPair+common
Expand Down

0 comments on commit f3f720e

Please sign in to comment.