tests: add test to make sure include_directories() order is maintained

This commit is contained in:
Tim-Philipp Müller 2018-01-25 22:25:36 +00:00 committed by Maxim Dzabraev
parent 2fa44cf326
commit 47508e217f
4 changed files with 17 additions and 0 deletions

View File

@ -0,0 +1 @@
#define SOME_DEFINE 42

View File

@ -0,0 +1 @@
#undef SOME_DEFINE

View File

@ -30,3 +30,7 @@ f = executable('somefxe', 'sub4/main.c',
test('eh', e)
test('oh', f)
# Test that the order in include_directories() is maintained
incs = include_directories('inc1', 'inc2')
executable('ordertest', 'ordertest.c', include_directories: incs)

View File

@ -0,0 +1,11 @@
#include "hdr.h"
#if !defined(SOME_DEFINE) || SOME_DEFINE != 42
#error "Should have picked up hdr.h from inc1/hdr.h"
#endif
int
main (int c, char ** argv)
{
return 0;
}