tests: add test to make sure include_directories() order is maintained
This commit is contained in:
parent
2fa44cf326
commit
47508e217f
|
@ -0,0 +1 @@
|
||||||
|
#define SOME_DEFINE 42
|
|
@ -0,0 +1 @@
|
||||||
|
#undef SOME_DEFINE
|
|
@ -30,3 +30,7 @@ f = executable('somefxe', 'sub4/main.c',
|
||||||
|
|
||||||
test('eh', e)
|
test('eh', e)
|
||||||
test('oh', f)
|
test('oh', f)
|
||||||
|
|
||||||
|
# Test that the order in include_directories() is maintained
|
||||||
|
incs = include_directories('inc1', 'inc2')
|
||||||
|
executable('ordertest', 'ordertest.c', include_directories: incs)
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
Loading…
Reference in New Issue