From 9a7d9e047bb66cedf5c06579a712c464b3c88366 Mon Sep 17 00:00:00 2001 From: StunxFS <56417208+StunxFS@users.noreply.github.com> Date: Mon, 8 Mar 2021 12:21:43 -0400 Subject: [PATCH] dl: move 'example' to 'examples/dynamic_library_loading' (#9187) --- .../modules/library}/library.v | 0 .../dynamic_library_loading}/use.v | 0 .../dynamic_library_loading}/use_test.v | 22 +++++++++---------- 3 files changed, 11 insertions(+), 11 deletions(-) rename {vlib/dl/example => examples/dynamic_library_loading/modules/library}/library.v (100%) rename {vlib/dl/example => examples/dynamic_library_loading}/use.v (100%) rename {vlib/dl/example => examples/dynamic_library_loading}/use_test.v (67%) diff --git a/vlib/dl/example/library.v b/examples/dynamic_library_loading/modules/library/library.v similarity index 100% rename from vlib/dl/example/library.v rename to examples/dynamic_library_loading/modules/library/library.v diff --git a/vlib/dl/example/use.v b/examples/dynamic_library_loading/use.v similarity index 100% rename from vlib/dl/example/use.v rename to examples/dynamic_library_loading/use.v diff --git a/vlib/dl/example/use_test.v b/examples/dynamic_library_loading/use_test.v similarity index 67% rename from vlib/dl/example/use_test.v rename to examples/dynamic_library_loading/use_test.v index 812281d8a2..5e36b05be7 100644 --- a/vlib/dl/example/use_test.v +++ b/examples/dynamic_library_loading/use_test.v @@ -11,20 +11,20 @@ const ( ) fn test_vexe() { - eprintln('vexe: $vexe') + dump(vexe) assert vexe != '' - eprintln('os.executable: ' + os.executable()) - eprintln('@FILE: ' + @FILE) - eprintln('cfolder: $cfolder') - eprintln('so_ext: $so_ext') - eprintln('library_file_name: $library_file_name') + dump(os.executable()) + dump(@FILE) + dump(cfolder) + dump(so_ext) + dump(library_file_name) } fn test_can_compile_library() { os.chdir(cfolder) os.rm(library_file_name) or { } - res := v_compile('-d no_backtrace -o library -shared library.v') - eprintln('res: $res') + res := v_compile('-d no_backtrace -o library -shared modules/library/library.v') + dump(res) assert os.is_file(library_file_name) } @@ -32,16 +32,16 @@ fn test_can_compile_main_program() { os.chdir(cfolder) assert os.is_file(library_file_name) result := v_compile('run use.v') - eprintln('result: $result') + dump(result) assert result.output.contains('res: 4') os.rm(library_file_name) or { } } fn v_compile(vopts string) os.Result { cmd := '"$vexe" -showcc $vopts' - eprintln('>>> v_compile cmd: $cmd') + dump(cmd) res := os.exec(cmd) or { panic(err) } - eprintln('>>> v_compile res: $res') + dump(res) // assert res.exit_code == 0 $if !windows { os.system('ls -al $cfolder')