v2 / vlib / v / pkgconfig / bin / pkgconfig_test.v
18 lines · 15 sloc · 492 bytes · e2e5cf8db56f3562c7baa735061690be936bdf3e
Raw
1import os
2
3const vexe = os.getenv('VEXE')
4
5const vroot = os.dir(vexe)
6
7fn test_pkgconfig_can_be_compiled() {
8 tmp_exe := os.join_path(os.vtmp_dir(), '${os.getpid()}_pkgconfig.exe')
9 pkgconfig_v_file := os.real_path(os.join_path(vroot, 'vlib/v/pkgconfig/bin/pkgconfig.v'))
10 assert !os.exists(tmp_exe)
11 res :=
12 os.system('${os.quoted_path(vexe)} -o ${os.quoted_path(tmp_exe)} ${os.quoted_path(pkgconfig_v_file)}')
13 if res != 0 {
14 assert false
15 }
16 assert os.exists(tmp_exe)
17 os.rm(tmp_exe)!
18}
19