Skip to content

Commit b93a3ca

Browse files
committed
Update docs to reflect replacement of jinja by gyb
1 parent 7b7bb7b commit b93a3ca

File tree

1 file changed

+11
-21
lines changed

1 file changed

+11
-21
lines changed

benchmark/README.md

Lines changed: 11 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ Using the Harness Generator
101101
`CMakeLists.txt` and `utils/main.swift` from single and multiple file tests
102102
contained in the directories `single-source` and `multi-source`. It gathers
103103
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
105105
manually add at least three lines to harness files (one to `CMakeLists.txt` and
106106
two to `utils/main.swift`) for every new benchmark added.
107107

@@ -110,34 +110,23 @@ two to `utils/main.swift`) for every new benchmark added.
110110
Since `CMakeLists.txt` and `utils/main.swift` are now generated from templates,
111111
they should not be directly modified. Work may be lost if the harness is
112112
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.
115114

116115
### Generating harness files
117116

118-
Start by installing jinja2 if it isn't already installed:
119-
120-
$ sudo easy_install -U jinja2
121-
122117
To generate `CMakeLists.txt` and `utils/main.swift` from test sources, run the
123118
command:
124119

125120
$ scripts/generate_harness/generate_harness.py
126121

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-
133122
### Modifying CMakeLists.txt or utils/main.swift
134123

135124
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`.
141130

142131
Adding New Benchmarks
143132
---------------------
@@ -149,7 +138,8 @@ To add a new single file test:
149138
1. Add a new Swift file (`YourTestNameHere.swift`), built according to
150139
the template below, to the `single-source` directory.
151140
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.
153143

154144
To add a new multiple file test:
155145

@@ -166,7 +156,8 @@ To add a new multiple file test:
166156
exist in the files.
167157

168158
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.
170161

171162
**Note:**
172163

@@ -204,4 +195,3 @@ public func run_YourTestNameHere(N: Int) {
204195
# Assert with CheckResults that work was done
205196
}
206197
```
207-

0 commit comments

Comments
 (0)