Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(36)

Side by Side Diff: testing/coverage_util_ios.mm

Issue 2789433004: Add tools for code coverage support in iOS. (Closed)
Patch Set: Feedback Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« ios/showcase/core/BUILD.gn ('K') | « testing/coverage_util_ios.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(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)
baxley 2017/04/03 17:18:53 nit: do we want the commented out condition?
13 static dispatch_once_t once_token;
14 dispatch_once(&once_token, ^{
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* documents_directory = [paths firstObject];
20 NSString* file_name = [documents_directory
21 stringByAppendingPathComponent:@"coverage.profraw"];
22
23 // For documentation, see:
24 // http://clang.llvm.org/docs/SourceBasedCodeCoverage.html
25 __llvm_profile_set_filename([file_name UTF8String]);
26
27 // Print the path for easier retrieval.
28 NSLog(@"Coverage data at %@.", file_name);
29 });
30 #endif
31 }
32
33 } // namespace coverage_util
OLDNEW
« ios/showcase/core/BUILD.gn ('K') | « testing/coverage_util_ios.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698