summaryrefslogtreecommitdiffstats
path: root/src/util_test.cc
Commit message (Collapse)AuthorAgeFilesLines
* Canonicalize "." to "."Colin Cross2015-12-161-16/+16
| | | | | "." is a legal path, if the string is empty after canonicalization return ".".
* Merge pull request #850 from sgraham/ocdNico Weber2014-11-121-2/+2
|\ | | | | whitespace/comment/wrap fixes, no intended functionality change
| * whitespace/comment/wrap fixes, no intended functionality changeScott Graham2014-11-121-2/+2
| |
* | set *err when too many components in CanonicalizePathScott Graham2014-11-121-0/+4
|/
* properly guard against slash_bits overflowScott Graham2014-11-121-0/+28
|
* fix CanonicalizePath going past StringPiece length + testScott Graham2014-11-101-0/+10
|
* fix order of args to CanonicalizePathScott Graham2014-11-091-19/+19
|
* remove CanonicalizePath overloads, test for toplevel behaviourScott Graham2014-11-091-2/+12
|
* fix multiple sequential slashesScott Graham2014-11-081-0/+15
|
* track back->forward conversions in a bitmaskScott Graham2014-11-081-0/+72
|
* CanonicalizePath handles \ on WindowsScott Graham2014-10-301-0/+66
|
* Allow + in filenames without escapingNico Weber2014-05-301-2/+2
| | | | | | Due to #690, file.c++ used to be escaped. + seems as safe as -, so allow it to not be escaped, to keep compile command lines with a fairly common extension slightly cleaner.
* Don’t unnecessarily escape backslashes in Win32 pathsNicholas Hutchinson2014-01-081-0/+8
| | | | Under ::CommandLineToArgvW() rules, the backslash character only gets special treatment if it’s immediately followed by a double quote. So, when checking to see if a string needs Win32 escaping, it’s sufficient to check for the presence of a double quote character. This allows paths like "foo\bar" to be recognised as “sensible” paths, which don’t require the full escaping.
* More robust escaping of $in, $out pathsNicholas Hutchinson2014-01-061-0/+23
| | | | | | In summary: don’t escape if the path doesn’t contain problematic characters, otherwise: - Shell: enclose string in single quotes, escape embedded single quotes with the magic quote-backslash-quote sequence - Win32: Escape double quotes by doubling the number of consecutive backslashes that precede them (if any) and adding one more. Finally, double the number of trailing backslashes, and enclose the whole thing in double quotes.
* drop std:: qualifiers on more stl datatypesEvan Martin2013-04-181-1/+1
| | | | We "using namespace std" anywhere we need a std::string or a std::vector.
* Merge pull request #401 from syntheticpp/win-network-pathEvan Martin2012-08-171-0/+16
|\ | | | | on windows a network path starts with two backslashes
| * on windows a network path starts with two backslashesPeter Kuemmel2012-08-171-0/+16
| |
* | windows: fix integer truncation issues for helper binariesEvan Martin2012-08-101-3/+3
|/ | | | | Disable the size_t truncation warning. (Note that this leaves on the other truncation-related warnings, like int->char.)
* Re-factor elide code and test it.Nicolas Despres2012-07-311-0/+11
|
* Speed up CanonicalizePath() 6.8% (322ms -> 300ms for chrome empty build).Nico Weber2012-05-041-0/+26
|
* Add a test for empty path in CanonicalizePath().Nicolas Despres2012-02-201-0/+3
| | | | | | | This test covers bug fix introduced by 62e9139740. However, reverting this patch does not trigger a test failure. Maybe, I am not testing on the right platform (Linux). Anyway, in all cases I think this test deserves to be added.
* don't crash when CanonicalizePath removes all path componentsEvan Martin2012-02-041-0/+17
| | | | From a patch from Peter Kuemmel <syntheticpp@gmx.net>.
* Strip ansi escape sequences from subcommand output when not writing to a ↵Nico Weber2012-01-191-0/+17
| | | | smart terminal.
* make CanonicalizePath report an error on empty pathEvan Martin2011-10-061-12/+19
| | | | Fixes part of issue 121, but the fix exposed a further issue.
* semantic change: allow reaching into parent directories in pathsEvan Martin2011-08-241-25/+30
| | | | | | | | | | | This allows generating build files in a subdirectory of your source tree. - Change CanonicalizePath to accept this. - CanonicalizePath no longer has an error condition, so change it to a void function. I profiled the result against Chrome and it might be ~100ms slower, but that might just be Chrome's size working against me. In any case I think there are lower-hanging performance fruit elsewhere.
* don't mangle absolute paths in the canonicalizerEvan Martin2011-05-171-0/+8
| | | | | We frequently do use absolute paths when depfiles refer to e.g. /usr/include/stdio.h.
* handle foo//bar in CanonicalizePathEvan Martin2011-04-221-0/+5
|
* Move CanonicalizePath into util.h so it can be shared by the other modules.Thiago Farina2011-04-151-0/+50
Also add util_test.cc and move the CanonicalizePathTest into there. Signed-off-by: Thiago Farina <tfarina@chromium.org>