Skip to content

Commit

Permalink
ci: fix vcreate_input_test.v on FreeBSD (expect is in /usr/local/bin …
Browse files Browse the repository at this point in the history
…there, if installed) (#19578)
  • Loading branch information
spytheman committed Oct 16, 2023
1 parent 44045c6 commit 0fb38ed
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/tools/vcreate/tests/new_with_model_arg.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3

Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vcreate/tests/new_with_name_arg.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3

Expand Down
2 changes: 1 addition & 1 deletion cmd/tools/vcreate/tests/new_with_no_arg.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3

Expand Down
15 changes: 12 additions & 3 deletions cmd/tools/vcreate/vcreate_input_test.v
Expand Up @@ -16,6 +16,12 @@ const (
expect_tests_path = os.join_path(@VMODROOT, 'cmd', 'tools', 'vcreate', 'tests')
)

fn testsuite_begin() {
dump(expect_exe)
dump(test_module_path)
dump(expect_tests_path)
}

fn prepare_test_path() ! {
os.rmdir_all(test_module_path) or {}
os.mkdir_all(test_module_path) or {}
Expand All @@ -25,7 +31,8 @@ fn prepare_test_path() ! {
fn test_new_with_no_arg_input() {
prepare_test_path()!
project_name := 'my_project'
res := os.execute('${os.join_path(expect_tests_path, 'new_with_no_arg.expect')} ${@VMODROOT} ${project_name}')
res := os.execute('${os.quoted_path(expect_exe)} ${os.join_path(expect_tests_path,
'new_with_no_arg.expect')} ${@VMODROOT} ${project_name}')
if res.exit_code != 0 {
assert false, res.output
}
Expand All @@ -46,7 +53,8 @@ fn test_new_with_no_arg_input() {
fn test_new_with_name_arg_input() {
prepare_test_path()!
project_name := 'my_other_project'
res := os.execute('${os.join_path(expect_tests_path, 'new_with_name_arg.expect')} ${@VMODROOT} ${project_name}')
res := os.execute('${os.quoted_path(expect_exe)} ${os.join_path(expect_tests_path,
'new_with_name_arg.expect')} ${@VMODROOT} ${project_name}')
if res.exit_code != 0 {
assert false, res.output
}
Expand All @@ -68,7 +76,8 @@ fn test_new_with_model_arg_input() {
prepare_test_path()!
project_name := 'my_lib'
model := 'lib'
res := os.execute('${os.join_path(expect_tests_path, 'new_with_model_arg.expect')} ${@VMODROOT} ${project_name} ${model}')
res := os.execute('${os.quoted_path(expect_exe)} ${os.join_path(expect_tests_path,
'new_with_model_arg.expect')} ${@VMODROOT} ${project_name} ${model}')
if res.exit_code != 0 {
assert false, res.output
}
Expand Down
2 changes: 1 addition & 1 deletion examples/password/tests/correct.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3
set v_root [exec sh -c "git rev-parse --show-toplevel"]
Expand Down
2 changes: 1 addition & 1 deletion examples/password/tests/incorrect.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3
set v_root [exec sh -c "git rev-parse --show-toplevel"]
Expand Down
2 changes: 1 addition & 1 deletion examples/password/tests/output_from_expect_arg.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3
set v_root [exec sh -c "git rev-parse --show-toplevel"]
Expand Down
2 changes: 1 addition & 1 deletion examples/readline/tests/readline.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3
set v_root [exec sh -c "git rev-parse --show-toplevel"]
Expand Down
2 changes: 1 addition & 1 deletion examples/readline/tests/readline_from_expect_arg.expect
@@ -1,4 +1,4 @@
#!/usr/bin/expect
#!/usr/bin/env expect

set timeout 3
set v_root [exec sh -c "git rev-parse --show-toplevel"]
Expand Down

0 comments on commit 0fb38ed

Please sign in to comment.