Adds print function to batch mode 91/165891/31
authorRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Thu, 4 Jan 2018 15:50:34 +0000 (16:50 +0100)
committerRadoslaw Cybulski <r.cybulski@partner.samsung.com>
Tue, 23 Jan 2018 11:37:24 +0000 (12:37 +0100)
Adds print function, which will output string to output file, if any was
given.

Change-Id: Idaad9f5db57ab108bcf4ca2da9fde7263a0b95b0

src/batch/BatchRunner.cpp

index af9e686..72bd832 100644 (file)
@@ -232,6 +232,12 @@ struct TestExecutor : ExecutorInterface {
                                return {};
                        }
                };
+               variables["print"] = detail::UserFunctionType<std::string> {
+                       [&](EvaluationContext & ec, std::string txt) -> EvaluationValue {
+                               output << txt << "\n";
+                               return {};
+                       }
+               };
                variables["get_at_point"] = detail::UserFunctionType<Point> {
                        [&](EvaluationContext & ec, Point pt) -> EvaluationValue {
                                return convert(pt);