From a1b811aada3220a3371e3c61b47946a9b9a0e029 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Sun, 29 Sep 2019 09:01:09 +0000 Subject: [PATCH] tests: Compile in advance Cargo is always trying to compile things if they are not ready yet. It caused the first test to take a lot of time, and potentially time out. --- src/meson.build | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 5cfd8006..62a69cfe 100644 --- a/src/meson.build +++ b/src/meson.build @@ -62,10 +62,26 @@ rslibs = custom_target( command: [cargo_script, '@OUTPUT@', 'build'] ) +build_rstests = custom_target( + 'build_rstests', + build_by_default: false, + # HACK: this target needs to build before all the tests, + # but it doesn't produce anything stable. + # Declaring build_by_default with some random but irrelevant output + # ensures that it's always built as it should + build_always_stale: true, + output: ['src'], + install: false, + console: true, + command: [cargo_script, '', 'build', '--tests'], + depends: rslibs, # no point building tests if the code itself fails +) + test( 'rstest', cargo_script, - args: ['', 'test'] + args: ['', 'test'], + depends: build_rstests, ) libsqueekboard = static_library('libsqueekboard',