diff --git a/vlib/v/pkgconfig/bin/pkgconfig_test.v b/vlib/v/pkgconfig/bin/pkgconfig_test.v new file mode 100644 index 0000000000..d0c4e9f5c2 --- /dev/null +++ b/vlib/v/pkgconfig/bin/pkgconfig_test.v @@ -0,0 +1,17 @@ +import os + +const vexe = os.getenv('VEXE') + +const vroot = os.dir(vexe) + +fn test_pkgconfig_can_be_compiled() ? { + tmp_exe := os.join_path(os.temp_dir(), '${os.getpid()}_pkgconfig.exe') + pkgconfig_v_file := os.real_path(os.join_path(vroot, 'vlib/v/pkgconfig/bin/pkgconfig.v')) + assert !os.exists(tmp_exe) + res := os.system('${os.quoted_path(vexe)} -o ${os.quoted_path(tmp_exe)} ${os.quoted_path(pkgconfig_v_file)}') + if res != 0 { + assert false + } + assert os.exists(tmp_exe) + os.rm(tmp_exe)? +} diff --git a/vlib/v/pkgconfig/main.v b/vlib/v/pkgconfig/main.v index 0064536746..e3ff155139 100644 --- a/vlib/v/pkgconfig/main.v +++ b/vlib/v/pkgconfig/main.v @@ -3,7 +3,7 @@ module pkgconfig import flag import strings -struct Main { +pub struct Main { pub mut: opt &MainOptions res string