summaryrefslogtreecommitdiff
path: root/test/test_c_flag_parsing.vader
AgeCommit message (Collapse)Author
2021-07-04fix: cflags parser: no absolute path for '-include' (#3775)Michael Jeanson
Both '-include' and '-imacros' take a file as an argument that will then be searched in the include path like a regular '#include "..."' statement in a source file. As such, they should not have their path converted to an absolute path. Signed-off-by: Michael Jeanson <mjeanson@efficios.com>
2021-03-20#3633 - Put all dummy test files in test/test-filesw0rp
2021-03-01Close #2281 - Separate cwd commands from commandsw0rp
Working directories are now set seperately from the commands so they can later be swapped out when running linters over projects is supported, and also better support filename mapping for running linters on other machines in future.
2021-02-05Add test case for gnumakefile detectionHugo Musso Gualandi
2020-12-21Add tests for -imacros C flagManoel Brunnen
2020-08-29Fix #3247 - Use --always-make for make -n by defaultw0rp
2020-08-27Fix #3318 - Escape macros when parsing C flagsw0rp
2020-08-27Fix C flag parsing and tests on Windowsw0rp
2020-08-27#3318 Refactor C flag parsing to set up for quoting argumentsw0rp
2020-08-27Label the test cases more clearlyw0rp
2020-08-27Fix #3317 - Parse -include from C flagsw0rp
2020-08-27Fix #3307 - Handle compile_commands paths betterw0rp
ALE now converts paths from compile_commands.json files into absolute paths and prefers matching against absolute file and directory names for determining which flags to use for files. As a result, parsing compile_commands.json to determine flags should work for a lot more C and C++ projects.
2020-08-20Keep -iframework if present in parsed C/C++ flags (#3057)awang
* Keep -iframework if present in parsed C/C++ flags * Add test to make sure -iframework is parsed Co-authored-by: Alex Wang <ts826848@gmail.com>
2020-08-19Fix #3200 - Do not use -fstack-usage from parsed flagsw0rp
2020-05-20Fixes #3092 - Implement loading `@file` c argumentsStephen Robinson
2019-08-17Fix cflags parsing (#2510, #2265) (#2590)fx-carton
* Parse CFLAGS that can be passed using a whitelist I went through GCC's man page and selected flags that can safely be passed to GCC and that can be useful to syntax checking. These include: - -I/-i* include flags - preprocessor flags such as -D - -W* warning flags - -O* optimization flags - most -f options - -m arch dependent options * Fix CFLAGS tests: -Idir is now parsed to -I dir * Added two tests for flags we want or don't want to pass. * Also check for / in addition to s:sep
2019-04-15#782 - Use compile commands for matching source files for headersw0rp
2019-01-27Fix #2195 - Handle the command key being missingw0rp
2019-01-24Parse more C/C++ compiler optionsLouis Xu
2019-01-10Merge pull request #2191 from davidvandebunte/fixCompDbDirw0rp
bugfix: c.vim: Pull build directory from compilation database
2019-01-09Cflags: added a test caseFrançois-Xavier Carton
2019-01-08bugfix: c.vim: Pull build directory from compilation databaseDavid VandeBunte
The LLVM compiler database JSON already includes a directory where the build was performed: https://clang.llvm.org/docs/JSONCompilationDatabase.html Prefer this directory for fixing relative paths in compiler include arguments in ale#c#ParseCFlags. Without this change, users cannot create a symlink to their compilation database as suggested in the LLVM tooling setup instructions: https://clang.llvm.org/docs/HowToSetupToolingForLLVM.html
2019-01-06Improve perf for compile dbs in large projectsJacob Segal
When using a compilation database (compile_commands.json) in very large projects, significant delays would occur when changing files -- particularly those that happened to be far down the db. Rather than iterating over the whole list every time, we now build up a lookup table based on the tail of the filename (and tail of the directory for widening searches) and iterate over the much smaller list of compile commands for files with the given name. Test metrics (from compile_database_perf/test.sh) show a 90% performance improvement -- from 25 seconds to 2.5 seconds per run.
2018-12-29Add a test for cflags merging bugFrançois-Xavier Carton
2018-11-17Fix bug where last c flag was ignoredJacob Segal
There is currently a check that tries to prevent c-flags that contain '-' in them from being unintentionally split and included in the list of commands. For example, we wouldn't want "-fno-exceptions " to appear as "-fno" and "-exceptions ". The way this check was done was by making sure the last character of the split string was a space. This meant that the very last option to appear in the compile command was ignored (as it doesn't end with a space). This fix explicitly skips the ends-with-space check on the last option in the command-line. This isn't the best fix. Really we should be using the same argument-processing rules as a shell would rather than just splitting on '-'. That's a much larger and more complicated change though.
2018-09-18add test for arguments with '--'James Ye
2018-07-29Try to fix the C parsing test on Windowsw0rp
2018-07-29Add support for parsing compile_commands.json files for C compilersw0rp