Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vcreate: test new module creation #19519

Merged
merged 9 commits into from
Oct 9, 2023

Conversation

ttytm
Copy link
Member

@ttytm ttytm commented Oct 6, 2023

🤖 Generated by Copilot at 6b25370

This pull request adds a test function and a script for the vcreate tool. The test function uses the expect tool and the v.vmod module to check the interactive input and output of the v create command. The script new_no_arg.expect simulates the user input for creating a new project.

🤖 Generated by Copilot at 6b25370

  • Add a new file new_no_arg.expect to test the interactive input of the v create command (F0)
  • Import the v.vmod module in vcreate_test.v to use its functions for decoding the v.mod file (link)
  • Add a new test function test_input in vcreate_test.v that uses the new_no_arg.expect script to create and verify a project with given input values (link)

@ttytm ttytm force-pushed the vcreate/test-new-module-creation branch 7 times, most recently from 7caca5f to 0f4f951 Compare October 9, 2023 11:00
@ttytm ttytm force-pushed the vcreate/test-new-module-creation branch from daa8011 to ff4ba60 Compare October 9, 2023 12:23
@ttytm ttytm force-pushed the vcreate/test-new-module-creation branch from 16bdbbd to e72a962 Compare October 9, 2023 14:08
set project_name [lindex $argv 1]
set model [lindex $argv 2]

spawn $v_root/v run $v_root/cmd/tools/vcreate/ new $project_name $model
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
spawn $v_root/v run $v_root/cmd/tools/vcreate/ new $project_name $model
spawn $v_root/v new $project_name $model

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be closer to what the final user will type/run . V should take care of compiling its cmd/tools/vcreate and then run it by itself.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That's certainly closer to the actual usage.
It seems that using v new for the compiled v executable doesn't want to work yet on mac. Mac wasn't failing when running vcreate.v directly.

ttytm and others added 2 commits October 9, 2023 16:41
Co-authored-by: Delyan Angelov <delian66@gmail.com>
@spytheman spytheman merged commit 4dee1e0 into vlang:master Oct 9, 2023
29 of 30 checks passed
@ttytm ttytm deleted the vcreate/test-new-module-creation branch October 25, 2023 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants