Mesa (main): freedreno/tools: Fix build failure when cffdump isn't built but tests are.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Oct 5 00:36:16 UTC 2021
Module: Mesa
Branch: main
Commit: 85e428f1e01d66090d110b28a85489c32baff746
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=85e428f1e01d66090d110b28a85489c32baff746
Author: Emma Anholt <emma at anholt.net>
Date: Mon Oct 4 14:54:08 2021 -0700
freedreno/tools: Fix build failure when cffdump isn't built but tests are.
Can't test the tool if we don't build it. Move the other test definition
next to the tool, too.
Fixes: 82b5c9526592 ("freedreno: Move crashdec/cffdec tests to be meson unit tests.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13183>
---
src/freedreno/decode/meson.build | 95 +++++++++++++++++++++-------------------
1 file changed, 49 insertions(+), 46 deletions(-)
diff --git a/src/freedreno/decode/meson.build b/src/freedreno/decode/meson.build
index de38ed5c1da..7f7a0801c4e 100644
--- a/src/freedreno/decode/meson.build
+++ b/src/freedreno/decode/meson.build
@@ -18,6 +18,10 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
+if with_tests
+ diff = find_program('diff')
+endif
+
# Shared cmdstream decoding:
libfreedreno_cffdec = static_library(
'freedreno_cffdec',
@@ -93,6 +97,37 @@ if dep_lua.found() and dep_libarchive.found()
build_by_default: with_tools.contains('freedreno'),
install: install_fd_decode_tools,
)
+
+ if with_tests
+ # dump only a single frame, and single tile pass, to keep the
+ # reference output size managable
+ cffdump_tests = [
+ ['fd-clouds', ['--frame', '0', '--once']],
+ ['es2gears-a320', ['--frame', '0', '--once']],
+ ['glxgears-a420', ['--frame', '1', '--once']],
+ ['dEQP-GLES2.functional.texture.specification.basic_teximage2d.rgba16f_2d', ['--once']],
+ ['dEQP-VK.draw.indirect_draw.indexed.indirect_draw_count.triangle_list', ['--frame', '0', '--once']],
+ # Test a lua script to ensure we don't break scripting API
+ ['shadow', ['--script', files(join_paths(meson.current_source_dir(), 'scripts', 'parse-submits.lua'))]],
+ ]
+ foreach cffdump_test: cffdump_tests
+ name = cffdump_test[0]
+ args = cffdump_test[1]
+
+ log = custom_target(name + '.log',
+ output: name + '.log',
+ command: [cffdump, '--unit-test', args, files('../.gitlab-ci/traces/' + name + '.rd.gz')],
+ capture: true,
+ )
+ test('cffdump-' + name,
+ diff,
+ args: ['-u', files('../.gitlab-ci/reference/' + name + '.log'), log],
+ suite: 'freedreno',
+ workdir: meson.source_root()
+ )
+
+ endforeach
+ endif
endif
crashdec = executable(
@@ -113,6 +148,20 @@ crashdec = executable(
install: install_fd_decode_tools,
)
+if with_tests
+ crashdec_output = custom_target('crashdec.txt',
+ output: 'crashdec.txt',
+ command: [crashdec, '-sf', files('../.gitlab-ci/traces/crash.devcore')],
+ capture: true
+ )
+ test('crashdec',
+ diff,
+ args: ['-u', files('../.gitlab-ci/reference/crash.log'), crashdec_output],
+ suite: 'freedreno',
+ workdir: meson.source_root()
+ )
+endif
+
if dep_libarchive.found()
pgmdump = executable(
'pgmdump',
@@ -153,49 +202,3 @@ if dep_libarchive.found()
install: false,
)
endif
-
-if with_tests
- diff = find_program('diff')
-
- crashdec_output = custom_target('crashdec.txt',
- output: 'crashdec.txt',
- command: [crashdec, '-sf', files('../.gitlab-ci/traces/crash.devcore')],
- capture: true
- )
- test('crashdec',
- diff,
- args: ['-u', files('../.gitlab-ci/reference/crash.log'), crashdec_output],
- suite: 'freedreno',
- workdir: meson.source_root()
- )
-
- # dump only a single frame, and single tile pass, to keep the
- # reference output size managable
- cffdump_tests = [
- ['fd-clouds', ['--frame', '0', '--once']],
- ['es2gears-a320', ['--frame', '0', '--once']],
- ['glxgears-a420', ['--frame', '1', '--once']],
- ['dEQP-GLES2.functional.texture.specification.basic_teximage2d.rgba16f_2d', ['--once']],
- ['dEQP-VK.draw.indirect_draw.indexed.indirect_draw_count.triangle_list', ['--frame', '0', '--once']],
- # Test a lua script to ensure we don't break scripting API
- ['shadow', ['--script', files(join_paths(meson.current_source_dir(), 'scripts', 'parse-submits.lua'))]],
- ]
- foreach cffdump_test: cffdump_tests
- name = cffdump_test[0]
- args = cffdump_test[1]
-
- log = custom_target(name + '.log',
- output: name + '.log',
- command: [cffdump, '--unit-test', args, files('../.gitlab-ci/traces/' + name + '.rd.gz')],
- capture: true,
- )
- test('cffdump-' + name,
- diff,
- args: ['-u', files('../.gitlab-ci/reference/' + name + '.log'), log],
- suite: 'freedreno',
- workdir: meson.source_root()
- )
-
- endforeach
-
-endif
More information about the mesa-commit
mailing list