Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change-Id: I97d55ce5d1f21f4a72075021d03ed90eb9e3625b Reviewed-on: http://review.couchbase.org/20709 Reviewed-by: Sergey Avseyev <sergey.avseyev@gmail.com> Reviewed-by: Trond Norbye <trond.norbye@gmail.com> Tested-by: Trond Norbye <trond.norbye@gmail.com>
- Loading branch information
Showing
10 changed files
with
2,109 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
doc |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
To generate documentation for the tests, run doxygen in the current directory |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/usr/bin/perl | ||
|
||
# Google tests don't really play nicely with Doxygen, so we need to | ||
# Convert the TEST_F macro into something Doxygen can eat. To do this we need | ||
# to convert it to a simple function declaration, and trick into thinking | ||
# the methods have been declared | ||
|
||
use strict; | ||
use warnings; | ||
use File::Path qw(mkpath rmtree); | ||
|
||
my $fname = $ARGV[0]; | ||
|
||
my @lines; | ||
my %classes; | ||
|
||
open my $fh, "<", $fname or die "$fname: $!"; | ||
while ( (my $line = <$fh>) ) { | ||
my $re = qr/TEST_F\(\s*([[:alnum:]]+)\s*,\s*([[:alnum:]]+)\s*\)/; | ||
my ($cls,$fn) = ($line =~ $re); | ||
if ($cls) { | ||
push @{$classes{$cls}}, $fn; | ||
$line =~ s/TEST_F[^{]+/$cls\::$fn() /g; | ||
} | ||
push @lines, $line; | ||
} | ||
|
||
while (my ($cls,$functions) = each %classes) { | ||
my $decl = "// Contents of this class auto-generated by $0\n"; | ||
$decl .= "class $cls {\npublic: \n"; | ||
foreach my $func (@$functions) { | ||
$decl .= " void $func(); \n"; | ||
} | ||
$decl .= "};\n"; | ||
unshift @lines, "#line \"$fname\" 0\n"; | ||
unshift @lines, $decl; | ||
} | ||
|
||
print @lines; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.