@@ -101,7 +101,7 @@ Using the Harness Generator
101
101
` CMakeLists.txt ` and ` utils/main.swift ` from single and multiple file tests
102
102
contained in the directories ` single-source ` and ` multi-source ` . It gathers
103
103
information about the tests and then generates the files from templates using
104
- jinja2 . The motivation for creating this script was to eliminate the need to
104
+ ` gyb ` . The motivation for creating this script was to eliminate the need to
105
105
manually add at least three lines to harness files (one to ` CMakeLists.txt ` and
106
106
two to ` utils/main.swift ` ) for every new benchmark added.
107
107
@@ -110,34 +110,23 @@ two to `utils/main.swift`) for every new benchmark added.
110
110
Since ` CMakeLists.txt ` and ` utils/main.swift ` are now generated from templates,
111
111
they should not be directly modified. Work may be lost if the harness is
112
112
executed after making changes to derived files. Instead, modifications should
113
- be made to the template files stored in the ` scripts/generate_harness `
114
- directory.
113
+ be made to the ` *.gyb ` template files.
115
114
116
115
### Generating harness files
117
116
118
- Start by installing jinja2 if it isn't already installed:
119
-
120
- $ sudo easy_install -U jinja2
121
-
122
117
To generate ` CMakeLists.txt ` and ` utils/main.swift ` from test sources, run the
123
118
command:
124
119
125
120
$ scripts/generate_harness/generate_harness.py
126
121
127
- ** Note:**
128
-
129
- Ensure ` generate_harness.py ` remains in ` scripts/generate_harness ` as it
130
- modifies files relative to its location instead of the current working
131
- directory.
132
-
133
122
### Modifying CMakeLists.txt or utils/main.swift
134
123
135
124
To make changes to ` CMakeLists.txt ` or ` utils/main.swift ` , modify the template
136
- files ` CMakeLists.txt_template ` and ` main.swift_template ` stored in the
137
- ` scripts/generate_harness ` directory. These are jinja2 templates, rendered by
138
- jinja2 calls in ` generate_harness.py ` , so ensure static changes don't interfere
139
- with the template portions. Test changes by regenerating the harness
140
- ( * Generating harness files * ) and rebuilding the repository with ` build-script ` .
125
+ files ` CMakeLists.txt.gyb ` and ` main.swift.gyb ` These are templates, rendered by
126
+ ` gyb ` in ` generate_harness.py ` , so ensure static changes don't interfere
127
+ with the template portions. Test changes by
128
+ [ regenerating the harness ] ( #generating-harness-files ) and rebuilding the
129
+ repository with ` build-script ` .
141
130
142
131
Adding New Benchmarks
143
132
---------------------
@@ -149,7 +138,8 @@ To add a new single file test:
149
138
1 . Add a new Swift file (` YourTestNameHere.swift ` ), built according to
150
139
the template below, to the ` single-source ` directory.
151
140
2 . Regenerate harness files by following the directions in
152
- * Generating harness files* before committing changes.
141
+ [ Generating harness files] ( #generating-harness-files ) before committing
142
+ changes.
153
143
154
144
To add a new multiple file test:
155
145
@@ -166,7 +156,8 @@ To add a new multiple file test:
166
156
exist in the files.
167
157
168
158
2 . Regenerate harness files by following the directions in
169
- * Generating harness files* before committing changes.
159
+ [ Generating harness files] ( #generating-harness-files ) before committing
160
+ changes.
170
161
171
162
** Note:**
172
163
@@ -204,4 +195,3 @@ public func run_YourTestNameHere(N: Int) {
204
195
# Assert with CheckResults that work was done
205
196
}
206
197
```
207
-
0 commit comments