Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #import <Foundation/Foundation.h> | |
| 6 | |
| 7 extern "C" void __llvm_profile_set_filename(const char* name); | |
| 8 | |
| 9 namespace coverage_util { | |
| 10 | |
| 11 void SetupIfNecessary() { | |
| 12 #if !defined(NDEBUG)// && defined(ENABLE_TEST_CODE_COVERAGE) | |
|
lpromero
2017/03/31 11:22:06
I commented the ENABLE_TEST_CODE_COVERAGE variable
| |
| 13 static dispatch_once_t onceToken; | |
|
Eugene But (OOO till 7-30)
2017/03/31 18:27:51
s/onceToken/once_token
Same Style comment for the
lpromero
2017/03/31 20:35:20
Since this is now a .mm file, isn't it Objective-C
Eugene But (OOO till 7-30)
2017/03/31 20:42:13
C++ Style is used inside C-functions in C++ namesp
| |
| 14 dispatch_once(&onceToken, ^{ | |
| 15 // Writes the profraw file to the Documents directory, where the app has | |
| 16 // write rights. | |
| 17 NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, | |
| 18 NSUserDomainMask, YES); | |
| 19 NSString *documentsDirectory = [paths firstObject]; | |
| 20 NSString *fileName = | |
| 21 [documentsDirectory stringByAppendingPathComponent:@"coverage.profraw"]; | |
| 22 | |
| 23 // For documentation, see: | |
| 24 // http://clang.llvm.org/docs/SourceBasedCodeCoverage.html | |
| 25 __llvm_profile_set_filename([fileName UTF8String]); | |
|
Eugene But (OOO till 7-30)
2017/03/31 18:27:51
Use sys_string_conversions ?
lpromero
2017/03/31 20:35:20
So there is a catch22 :)
base depends on //testing
| |
| 26 | |
| 27 // Print the path for easier retrieval. | |
| 28 NSLog(@"Coverage data at %@.", fileName); | |
|
Eugene But (OOO till 7-30)
2017/03/31 18:27:51
Should this be DLOG instead?
lpromero
2017/03/31 20:35:20
Idem, I can't use base/logging.h.
| |
| 29 }); | |
| 30 #endif | |
| 31 } | |
| 32 | |
| 33 } // namespace coverage_util | |
| OLD | NEW |