summaryrefslogtreecommitdiff
path: root/compiler/cpp/tests/ocaml/README.md
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/cpp/tests/ocaml/README.md')
-rw-r--r--compiler/cpp/tests/ocaml/README.md16
1 files changed, 16 insertions, 0 deletions
diff --git a/compiler/cpp/tests/ocaml/README.md b/compiler/cpp/tests/ocaml/README.md
new file mode 100644
index 000000000..e79a88792
--- /dev/null
+++ b/compiler/cpp/tests/ocaml/README.md
@@ -0,0 +1,16 @@
+## Testing approach
+
+1. Programmatically construct parsed instances of Thrift IDLs using internal
+ types
+2. Generate the OCaml output using the OCaml generator
+3. Capture the generated output in `ostringstream`
+4. Query and compare the outputs in the strings to stored snapshots in the
+ `snapshot_*.cc` files
+
+Run tests in `../tests` directory:
+
+ # Only on changing build definition:
+ cmake -DCMAKE_PREFIX_PATH=/usr/local/opt/bison -DCMAKE_CXX_STANDARD=11 .
+
+ # On each iteration:
+ rm -rf gen-ocaml; cmake --build . && ctest --output-on-failure