Skip to content
Snippets Groups Projects
meson.build 1.31 KiB
tests = {
		  'SimpleFibTest.cpp':
		  {
			'description': 'Simple test',
		  },

		  'SimplestFibTest.cpp':
		  {
			'description': 'Simplest fib test',
			'test_suite': 'smoke',
		  },

		  'c_api_test.c':
		  {
			'description': 'Test EMPER\'s C API',
		  },

		  'CppApiTest.cpp':
		  {
			'description': 'Test EMPER\'s C++ API',
		  },

		  # 'SimpleActorTest.cpp':
		  # {
		  # 	'description': 'Simple Actor Test',
		  # 	'test_suite': 'broken',
		  # },

		  'SimpleLawsTest.cpp':
		  {
			'description': 'Simple LAWS scheduling strategy test',
		  },
		}

undef_ndebug = '-UNDEBUG'
test_dep = [thread_dep]

foreach source, test_dict : tests
  # TODO: Use meson fs (filesystem) module once meson >= 0.53 is in
  # buster-backports, instead of split('.')[0]
  # test_name = fs.replace_suffix(source, '')
  # The test_name is the name of the source file without the file suffix.
  test_name = source.split('.')[0]

  test_exe = executable(test_name,
						source,
						include_directories: emper_all_include,
						c_args: undef_ndebug,
						cpp_args: undef_ndebug,
						dependencies: test_dep,
						link_with: [emper, emper_c],
					   )

  test(test_dict.get('description', ''),
	   test_exe,
	   is_parallel: test_dict.get('is_parallel', true),
	   suite: test_dict.get('test_suite', 'all'),
	   timeout: 60
	  )
endforeach