v2 / vlib / v / tests / cflags / vmodroot_and_vroot_test.c.v
17 lines · 14 sloc · 446 bytes · 1e1a0223ac7dd035337b66519957bbf9deda3213
Raw
1// Tests that the deprecated @VROOT alias still resolves to the nearest v.mod file,
2// which in this case is in the current folder.
3// ==> @VROOT/includes === ./includes
4#flag -I@VROOT/includes
5#include "myinclude.h"
6
7fn C.add(i32, i32) i32
8
9// Tests that VEXEROOT works no matter the current folder.
10#flag -I @VEXEROOT/thirdparty/stb_image
11#include "stb_image.h"
12
13fn test_vroot_and_vmodroot() {
14 x := C.add(123, 456)
15 dump(x)
16 assert x == 579
17}
18