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.
This commit is contained in:
		@ -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',
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user