| 1 | #!/usr/bin/env expect |
| 2 | |
| 3 | set timeout 10 |
| 4 | |
| 5 | # Pass v_root as arg, since we chdir into a temp directory during testing and create a project there. |
| 6 | set v_root [lindex $argv 0] |
| 7 | set project_name [lindex $argv 1] |
| 8 | |
| 9 | spawn $v_root/v new |
| 10 | |
| 11 | expect "Input your project name: " { send "$project_name\r" } timeout { exit 1 } |
| 12 | expect "Input your project description: " { send "My Awesome V Project.\r" } timeout { exit 1 } |
| 13 | expect "Input your project version: (0.0.0) " { send "0.1.0\r" } timeout { exit 1 } |
| 14 | expect "Input your project license: (MIT) " { send "GPL\r" } timeout { exit 1 } |
| 15 | expect "Initialising ..." {} timeout { exit 1 } |
| 16 | expect "Created binary (application) project `$project_name`" {} timeout { exit 1 } |
| 17 | |
| 18 | expect eof |
| 19 | |