summaryrefslogtreecommitdiff
path: root/test/test_c_flag_parsing.vader
diff options
context:
space:
mode:
authorFrançois-Xavier Carton <fx.carton91@gmail.com>2018-12-29 12:13:23 +0100
committerFrançois-Xavier Carton <fx.carton91@gmail.com>2018-12-29 12:16:22 +0100
commite5f33c65982aea8ef082d058a32a08a7883c5c1c (patch)
tree1bcd7791d2797943d549a247477e69ae33a71e2f /test/test_c_flag_parsing.vader
parentf7c4c403ebb2460e056bdb80463d75a32174bafa (diff)
downloadale-e5f33c65982aea8ef082d058a32a08a7883c5c1c.zip
Add a test for cflags merging bug
Diffstat (limited to 'test/test_c_flag_parsing.vader')
-rw-r--r--test/test_c_flag_parsing.vader17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/test_c_flag_parsing.vader b/test/test_c_flag_parsing.vader
index 8a9b7189..d3cb2b51 100644
--- a/test/test_c_flag_parsing.vader
+++ b/test/test_c_flag_parsing.vader
@@ -177,3 +177,20 @@ Execute(ParseCompileCommandsFlags should parse some basic flags):
\ 'file': ale#path#Simplify('/foo/bar/xmms2-mpris/src/xmms2-mpris.c'),
\ },
\ ])
+
+Execute(ParseCFlags should not merge flags):
+ AssertEqual
+ \ '-Dgoal=9'
+ \ . ' ' . ale#Escape('-I' . ale#path#Simplify(g:dir. '/test_c_projects/makefile_project/subdir'))
+ \ . ' ' . ale#Escape('-I' . ale#path#Simplify(g:dir. '/test_c_projects/makefile_project/dir with spaces'))
+ \ . ' ' . ale#Escape('-I' . ale#path#Simplify(g:dir. '/test_c_projects/makefile_project/dir-with-dash'))
+ \ . ' ' . ale#Escape('-I' . ale#path#Simplify(g:dir. '/test_c_projects/makefile_project/kernel/include')),
+ \ ale#c#ParseCFlags(
+ \ ale#path#Simplify(g:dir. '/test_c_projects/makefile_project'),
+ \ 'gcc -Dgoal=9 -Tlinkerfile.ld blabla -Isubdir '
+ \ . 'subdir/somedep1.o ' . 'subdir/somedep2.o '
+ \ . '-I''dir with spaces''' . ' -Idir-with-dash '
+ \ . 'subdir/somedep3.o ' . 'subdir/somedep4.o '
+ \ . ' -I'. ale#path#Simplify('kernel/include') . ' '
+ \ . 'subdir/somedep5.o ' . 'subdir/somedep6.o '
+ \ )