@@ -8,26 +8,31 @@ Before:
8
8
let test_dir = fnamemodify(getcwd(), ':p')
9
9
endif
10
10
11
- Assert !isdirectory("test project/build"), "TEST ERROR: build directory was not properly deleted"
12
- echo system("mkdir 'test project/build'")
13
- Assert isdirectory("test project/build"), "TEST ERROR: build directory was not created"
11
+ Assert !isdirectory("test project/tmp- build"), "TEST ERROR: build directory was not properly deleted"
12
+ echo system("mkdir 'test project/tmp- build'")
13
+ Assert isdirectory("test project/tmp- build"), "TEST ERROR: build directory was not created"
14
14
15
+ " Under travis CI the entire project is in a build/ directory
16
+ " which will make the search from cwd always return a result.
17
+ " To be able to test searching build dir from current file, the
18
+ " build dir needs to be named differently as a workaround.
19
+ let g:cmake_build_dir = "tmp-build"
15
20
After:
16
21
exec "cd" fnameescape(test_dir)
17
- echo system("rm -rf 'test project/build'")
22
+ echo system("rm -rf 'test project/tmp- build'")
18
23
echo system("rm -f 'test project/compile_commands.json'")
19
24
20
25
Execute (Find build directory from working dir):
21
26
cd test\ project
22
27
CMake
23
28
24
- Assert filereadable("build/CMakeCache.txt"), "CMakeCache.txt should be generated"
25
- Assert !filereadable("build/compile_commands.json"), "Compile commands should not be exported by default"
29
+ Assert filereadable("tmp- build/CMakeCache.txt"), "CMakeCache.txt should be generated"
30
+ Assert !filereadable("tmp- build/compile_commands.json"), "Compile commands should not be exported by default"
26
31
27
32
Execute (Find build directory from currently open file):
28
33
e test\ project/CMakeLists.txt
29
34
CMake
30
- Assert filereadable("test project/build/CMakeCache.txt"), "CMakeCache.txt should be generated"
35
+ Assert filereadable("test project/tmp- build/CMakeCache.txt"), "CMakeCache.txt should be generated"
31
36
32
37
Execute (Create symlink to compilation database):
33
38
let g:cmake_export_compile_commands = 1
@@ -37,12 +42,12 @@ Execute (Create symlink to compilation database):
37
42
38
43
" Exporting compile commands does not work with Visual Studio generator
39
44
if !has("win32") && !has("win32unix")
40
- Assert filereadable("build/compile_commands.json"), "Compile commands should be exported"
45
+ Assert filereadable("tmp- build/compile_commands.json"), "Compile commands should be exported"
41
46
Assert filereadable(resolve("compile_commands.json")), "A symlink should be generated"
42
47
endif
43
48
44
49
Execute (Open already configured cmake project):
45
- cd test\ project/build
50
+ cd test\ project/tmp- build
46
51
silent !cmake .. -DWITH_BYE=ON
47
52
e ../CMakeLists.txt
48
53
CMake
0 commit comments