64 const size_t kRuleSize = 4000;
65 string long_rule_command =
"gcc ";
66 for (
int i = 0; long_rule_command.size() < kRuleSize; ++i) {
68 sprintf(buf,
"-I../../and/arbitrary/but/fairly/long/path/suffixed/%d ", i);
69 long_rule_command += buf;
71 long_rule_command +=
"$in -o $out\n";
75 if (!parser.
ParseTest(
"rule cxx\n command = " + long_rule_command, err))
80 const int kNumCommands = 30000;
82 for (
int i = 0; i < kNumCommands; ++i) {
84 sprintf(buf,
"build input%d.o: cxx input%d.cc\n", i, i);
91 for (
int i = 0; i < kNumCommands; ++i) {
106 fprintf(stderr,
"Failed to write test data: %s\n", err.c_str());
114 fprintf(stderr,
"Failed to read test data: %s\n", err.c_str());
118 const int kNumRepetitions = 5;
119 for (
int i = 0; i < kNumRepetitions; ++i) {
123 fprintf(stderr,
"Failed to read test data: %s\n", err.c_str());
127 printf(
"%dms\n", delta);
128 times.push_back(delta);
134 for (
size_t i = 0; i < times.size(); ++i) {
138 else if (times[i] > max)
142 printf(
"min %dms max %dms avg %.1fms\n",
143 min, max, total / times.size());
vector< Edge * > edges_
All the edges of the graph.
StringPiece represents a slice of a string whose memory is managed externally.
int64_t GetTimeMillis()
Get the current time as relative to some epoch.
Store a log of every command ran for every build.
signed long long int64_t
A 64-bit integer type.
bool OpenForWrite(const string &path, const BuildLogUser &user, string *err)
bool WriteTestData(string *err)
virtual bool IsPathDead(StringPiece) const
Return if a given output no longer part of the build manifest.
const char kTestFilename[]
bool RecordCommand(Edge *edge, int start_time, int end_time, TimeStamp restat_mtime=0)
Global state (file status, loaded rules) for a single run.
bool Load(const string &path, string *err)
Load the on-disk log.
bool ParseTest(const string &input, string *err)
Parse a text string of input. Used by tests.
Can answer questions about the manifest for the BuildLog.