summaryrefslogtreecommitdiff
path: root/test/command_callback
diff options
context:
space:
mode:
authorBartek thindil Jasicki <thindil@laeran.pl>2020-08-14 19:38:09 +0200
committerBartek thindil Jasicki <thindil@laeran.pl>2020-08-14 19:38:09 +0200
commit04bd84e914af02e1c7d61ccf8f8368de85eab30e (patch)
treeda622d456ce01358a85a680f9fc8d802bc61ff01 /test/command_callback
parent973c4ea053f78d4daa6eceff36da0bbecd788077 (diff)
parent5ceda0164c5fae0d61fd51d4c9e083b27abdc9d2 (diff)
downloadale-04bd84e914af02e1c7d61ccf8f8368de85eab30e.zip
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'test/command_callback')
-rw-r--r--test/command_callback/test_c_clang_tidy_command_callback.vader10
-rw-r--r--test/command_callback/test_cargo_command_callbacks.vader24
-rw-r--r--test/command_callback/test_clang_tidy_command_callback.vader10
-rw-r--r--test/command_callback/test_cpp_clazy_command_callback.vader8
4 files changed, 37 insertions, 15 deletions
diff --git a/test/command_callback/test_c_clang_tidy_command_callback.vader b/test/command_callback/test_c_clang_tidy_command_callback.vader
index 5ebbbd45..c4433550 100644
--- a/test/command_callback/test_c_clang_tidy_command_callback.vader
+++ b/test/command_callback/test_c_clang_tidy_command_callback.vader
@@ -57,7 +57,7 @@ Execute(The build directory setting should override the options):
\ . ' -checks=' . ale#Escape('*') . ' %s'
\ . ' -p ' . ale#Escape('/foo/bar')
-Execute(The build directory should be ignored for header files):
+Execute(The build directory should be used for header files):
call ale#test#SetFilename('test.h')
let b:ale_c_clangtidy_checks = ['*']
@@ -66,12 +66,8 @@ Execute(The build directory should be ignored for header files):
AssertLinter 'clang-tidy',
\ ale#Escape('clang-tidy')
- \ . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
-
- call ale#test#SetFilename('test.h')
-
- AssertLinter 'clang-tidy',
- \ ale#Escape('clang-tidy') . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
+ \ . ' -checks=' . ale#Escape('*') . ' %s'
+ \ . ' -p ' . ale#Escape('/foo/bar')
Execute(The executable should be configurable):
let b:ale_c_clangtidy_checks = ['*']
diff --git a/test/command_callback/test_cargo_command_callbacks.vader b/test/command_callback/test_cargo_command_callbacks.vader
index e56551ae..2d83351e 100644
--- a/test/command_callback/test_cargo_command_callbacks.vader
+++ b/test/command_callback/test_cargo_command_callbacks.vader
@@ -169,10 +169,11 @@ Execute(Build supports all cargo flags):
let g:ale_rust_cargo_check_tests = 1
let g:ale_rust_cargo_check_examples = 1
let b:ale_rust_cargo_default_feature_behavior = 'all'
+ let b:ale_rust_cargo_target_dir = 'target/ale'
AssertLinter 'cargo', [
\ ale#Escape('cargo') . ' --version',
- \ 'cargo build --all-targets --examples --tests --frozen --message-format=json -q --all-features',
+ \ 'cargo build --all-targets --examples --tests --target-dir ' . ale#Escape('target/ale') . ' --frozen --message-format=json -q --all-features',
\]
Execute(Clippy supports all cargo flags):
@@ -182,10 +183,11 @@ Execute(Clippy supports all cargo flags):
let g:ale_rust_cargo_check_examples = 1
let b:ale_rust_cargo_default_feature_behavior = 'all'
let b:ale_rust_cargo_clippy_options = '-D warnings'
+ let b:ale_rust_cargo_target_dir = 'target/ale'
AssertLinter 'cargo', [
\ ale#Escape('cargo') . ' --version',
- \ 'cargo clippy --all-targets --examples --tests --frozen --message-format=json -q --all-features -- -D warnings',
+ \ 'cargo clippy --all-targets --examples --tests --target-dir ' . ale#Escape('target/ale') . ' --frozen --message-format=json -q --all-features -- -D warnings',
\]
Execute(cargo-check does not refer ale_rust_cargo_clippy_options):
@@ -197,3 +199,21 @@ Execute(cargo-check does not refer ale_rust_cargo_clippy_options):
\ ale#Escape('cargo') . ' --version',
\ 'cargo check --frozen --message-format=json -q',
\]
+
+Execute(`cargo --target-dir` should be used when the version is new enough and it is set):
+ let b:ale_rust_cargo_target_dir = 'target/ale'
+
+ GivenCommandOutput ['cargo 0.17.0 (3423351a5 2017-10-06)']
+ AssertLinter 'cargo', [
+ \ ale#Escape('cargo') . ' --version',
+ \ 'cargo check --target-dir ' . ale#Escape('target/ale') . g:suffix,
+ \]
+
+Execute(`cargo --target-dir` should not be used when the version is not new enough and it is set):
+ let b:ale_rust_cargo_target_dir = 'target/ale'
+
+ GivenCommandOutput ['cargo 0.16.0 (3423351a5 2017-10-06)']
+ AssertLinter 'cargo', [
+ \ ale#Escape('cargo') . ' --version',
+ \ 'cargo build' . g:suffix,
+ \]
diff --git a/test/command_callback/test_clang_tidy_command_callback.vader b/test/command_callback/test_clang_tidy_command_callback.vader
index c2d18dea..f0a07e8c 100644
--- a/test/command_callback/test_clang_tidy_command_callback.vader
+++ b/test/command_callback/test_clang_tidy_command_callback.vader
@@ -57,7 +57,7 @@ Execute(The build directory setting should override the options):
\ . ' -checks=' . ale#Escape('*') . ' %s'
\ . ' -p ' . ale#Escape('/foo/bar')
-Execute(The build directory should be ignored for header files):
+Execute(The build directory should be used for header files):
call ale#test#SetFilename('test.h')
let b:ale_cpp_clangtidy_checks = ['*']
@@ -66,12 +66,16 @@ Execute(The build directory should be ignored for header files):
AssertLinter 'clang-tidy',
\ ale#Escape('clang-tidy')
- \ . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
+ \ . ' -checks=' . ale#Escape('*') . ' %s'
+ \ . ' -p ' . ale#Escape('/foo/bar')
+ \ . ' -- -x c++'
call ale#test#SetFilename('test.hpp')
AssertLinter 'clang-tidy',
- \ ale#Escape('clang-tidy') . ' -checks=' . ale#Escape('*') . ' %s -- -Wall'
+ \ ale#Escape('clang-tidy')
+ \ . ' -checks=' . ale#Escape('*') . ' %s'
+ \ . ' -p ' . ale#Escape('/foo/bar')
Execute(The executable should be configurable):
let b:ale_cpp_clangtidy_checks = ['*']
diff --git a/test/command_callback/test_cpp_clazy_command_callback.vader b/test/command_callback/test_cpp_clazy_command_callback.vader
index 1be43b96..e5a81b8f 100644
--- a/test/command_callback/test_cpp_clazy_command_callback.vader
+++ b/test/command_callback/test_cpp_clazy_command_callback.vader
@@ -34,18 +34,20 @@ Execute(The build directory should be configurable):
\ ale#Escape('clazy-standalone')
\ . ' -checks=' . ale#Escape('level1') . ' -p ' . ale#Escape('/foo/bar') . ' %s'
-Execute(The build directory should be ignored for header files):
+Execute(The build directory should be used for header files):
call ale#test#SetFilename('test.h')
let b:ale_c_build_dir = '/foo/bar'
AssertLinter 'clazy-standalone',
- \ ale#Escape('clazy-standalone') . ' -checks=' . ale#Escape('level1') . ' %s'
+ \ ale#Escape('clazy-standalone')
+ \ . ' -checks=' . ale#Escape('level1') . ' -p ' . ale#Escape('/foo/bar') . ' %s'
call ale#test#SetFilename('test.hpp')
AssertLinter 'clazy-standalone',
- \ ale#Escape('clazy-standalone') . ' -checks=' . ale#Escape('level1') . ' %s'
+ \ ale#Escape('clazy-standalone')
+ \ . ' -checks=' . ale#Escape('level1') . ' -p ' . ale#Escape('/foo/bar') . ' %s'
Execute(The executable should be configurable):
let b:ale_cpp_clazy_executable = 'foobar'