| Yawar Amin | b17672a | 2022-09-10 11:55:02 -0400 | [diff] [blame] | 1 | ## Testing approach |
| 2 | |
| 3 | 1. Programmatically construct parsed instances of Thrift IDLs using internal |
| 4 | types |
| 5 | 2. Generate the OCaml output using the OCaml generator |
| 6 | 3. Capture the generated output in `ostringstream` |
| 7 | 4. Query and compare the outputs in the strings to stored snapshots in the |
| 8 | `snapshot_*.cc` files |
| 9 | |
| 10 | Run tests in `../tests` directory: |
| 11 | |
| 12 | # Only on changing build definition: |
| 13 | cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/bison -DCMAKE_CXX_STANDARD=11 . |
| 14 | |
| 15 | # On each iteration: |
| 16 | rm -rf gen-ocaml; cmake --build . && ctest --output-on-failure |