This repository was archived by the owner on Jun 15, 2023. It is now read-only.
File tree 2 files changed +10
-5
lines changed
2 files changed +10
-5
lines changed Original file line number Diff line number Diff line change @@ -112,12 +112,14 @@ struct Rule {
112
112
bool restat () const { return restat_; }
113
113
114
114
const EvalString& command () const { return command_; }
115
- EvalString& command () { return command_; }
116
115
const EvalString& description () const { return description_; }
117
116
const EvalString& depfile () const { return depfile_; }
118
117
const EvalString& rspfile () const { return rspfile_; }
119
118
const EvalString& rspfile_content () const { return rspfile_content_; }
120
119
120
+ // / Used by a test.
121
+ void set_command (const EvalString& command) { command_ = command; }
122
+
121
123
private:
122
124
// Allow the parsers to reach into this object and fill out its fields.
123
125
friend struct ManifestParser ;
Original file line number Diff line number Diff line change @@ -22,11 +22,14 @@ namespace {
22
22
TEST (State, Basic) {
23
23
State state;
24
24
25
+ EvalString command;
26
+ command.AddText (" cat " );
27
+ command.AddSpecial (" in" );
28
+ command.AddText (" > " );
29
+ command.AddSpecial (" out" );
30
+
25
31
Rule* rule = new Rule (" cat" );
26
- rule->command ().AddText (" cat " );
27
- rule->command ().AddSpecial (" in" );
28
- rule->command ().AddText (" > " );
29
- rule->command ().AddSpecial (" out" );
32
+ rule->set_command (command);
30
33
state.AddRule (rule);
31
34
32
35
Edge* edge = state.AddEdge (rule);
You can’t perform that action at this time.
0 commit comments