2022-03-10 20:56:14 -05:00
|
|
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
|
|
|
|
|
|
|
use crate::itest;
|
|
|
|
|
|
|
|
// Most of the tests for this are in deno_task_shell.
|
|
|
|
// These tests are intended to only test integration.
|
|
|
|
|
|
|
|
itest!(task_no_args {
|
2022-03-11 20:35:18 -05:00
|
|
|
args: "task -q --config task/deno.json",
|
2022-03-10 20:56:14 -05:00
|
|
|
output: "task/task_no_args.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
exit_code: 1,
|
|
|
|
});
|
2022-06-08 17:30:16 -04:00
|
|
|
|
|
|
|
itest!(task_cwd {
|
|
|
|
args: "task -q --config task/deno.json --cwd .. echo_cwd",
|
|
|
|
output: "task/task_cwd.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
exit_code: 0,
|
|
|
|
});
|
2022-07-20 10:36:14 -04:00
|
|
|
|
|
|
|
itest!(task_cwd_resolves_config_from_specified_dir {
|
|
|
|
args: "task -q --cwd task",
|
|
|
|
output: "task/task_no_args.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
exit_code: 1,
|
|
|
|
});
|
2022-03-10 20:56:14 -05:00
|
|
|
|
|
|
|
itest!(task_non_existent {
|
|
|
|
args: "task --config task/deno.json non_existent",
|
|
|
|
output: "task/task_non_existent.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
exit_code: 1,
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(task_boolean_logic {
|
2022-03-11 20:35:18 -05:00
|
|
|
args: "task -q --config task/deno.json boolean_logic",
|
2022-03-10 20:56:14 -05:00
|
|
|
output: "task/task_boolean_logic.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
});
|
|
|
|
|
2022-03-15 21:24:07 -04:00
|
|
|
itest!(task_exit_code_5 {
|
2022-03-10 20:56:14 -05:00
|
|
|
args: "task --config task/deno.json exit_code_5",
|
|
|
|
output: "task/task_exit_code_5.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
exit_code: 5,
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(task_additional_args {
|
2022-03-11 20:35:18 -05:00
|
|
|
args: "task -q --config task/deno.json echo 2",
|
2022-03-10 20:56:14 -05:00
|
|
|
output: "task/task_additional_args.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(task_additional_args_no_shell_expansion {
|
2022-03-11 20:35:18 -05:00
|
|
|
args_vec: vec![
|
|
|
|
"task",
|
|
|
|
"-q",
|
|
|
|
"--config",
|
|
|
|
"task/deno.json",
|
|
|
|
"echo",
|
|
|
|
"$(echo 5)"
|
|
|
|
],
|
2022-03-10 20:56:14 -05:00
|
|
|
output: "task/task_additional_args_no_shell_expansion.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(task_additional_args_nested_strings {
|
|
|
|
args_vec: vec![
|
|
|
|
"task",
|
2022-03-11 20:35:18 -05:00
|
|
|
"-q",
|
2022-03-10 20:56:14 -05:00
|
|
|
"--config",
|
|
|
|
"task/deno.json",
|
|
|
|
"echo",
|
|
|
|
"string \"quoted string\""
|
|
|
|
],
|
|
|
|
output: "task/task_additional_args_nested_strings.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
});
|
|
|
|
|
|
|
|
itest!(task_additional_args_no_logic {
|
|
|
|
args_vec: vec![
|
|
|
|
"task",
|
2022-03-11 20:35:18 -05:00
|
|
|
"-q",
|
2022-03-10 20:56:14 -05:00
|
|
|
"--config",
|
|
|
|
"task/deno.json",
|
|
|
|
"echo",
|
|
|
|
"||",
|
|
|
|
"echo",
|
|
|
|
"5"
|
|
|
|
],
|
|
|
|
output: "task/task_additional_args_no_logic.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
});
|
2022-05-23 12:04:28 -04:00
|
|
|
|
|
|
|
itest!(task_deno_exe_no_env {
|
|
|
|
args_vec: vec!["task", "-q", "--config", "task/deno.json", "deno_echo"],
|
|
|
|
output: "task/task_deno_exe_no_env.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
env_clear: true,
|
|
|
|
});
|
2022-05-23 12:35:02 -04:00
|
|
|
|
|
|
|
itest!(task_piped_stdin {
|
|
|
|
args_vec: vec!["task", "-q", "--config", "task/deno.json", "piped"],
|
|
|
|
output: "task/task_piped_stdin.out",
|
|
|
|
envs: vec![("NO_COLOR".to_string(), "1".to_string())],
|
|
|
|
});
|