./
Coverage:
low: ≥ 0%
medium: ≥ 75.0%
high: ≥ 90.0%
Lines:
0 / 13
0.0%
Branches:
0 / 25
0.0%
Functions:
0 / 4
0.0%

apps/runner/src/eu/runner/script.cc
Line Branch Exec Source
1 #include "eu/runner/script.h"
2
3 #include "eu/io/file.h"
4
5 #include "lax/lax.h"
6 #include "lax/printhandler.h"
7
8 namespace eu::runner
9 {
10
11
12 struct PrintLaxError : lax::PrintHandler
13 {
14 ✗ void on_line(std::string_view line) override
15 {
16
0/4
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 9 not taken.
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 7 not taken.
✗ LOG_ERR("> {0}", line);
17 ✗ }
18 };
19
20
21 ✗ Script:: Script()
22
0/7
✗ Branch 3 → 4 not taken.
✗ Branch 3 → 9 not taken.
✗ Branch 3 → 14 not taken.
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 7 not taken.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 10 not taken.
✗ : lax(std::make_unique<PrintLaxError>(), [](const std::string& str) { LOG_INFO("> {0}", str); })
23 {
24 ✗ }
25
26 ✗ bool Script::run_file(const std::string& file)
27 {
28
0/4
✗ Branch 4 → 5 not taken.
✗ Branch 4 → 20 not taken.
✗ Branch 5 → 6 not taken.
✗ Branch 5 → 18 not taken.
✗ const auto content = io::string_from_file("main.lax");
29
0/2
✗ Branch 8 → 9 not taken.
✗ Branch 8 → 28 not taken.
✗ const auto result = lax.run_string(content);
30
31
0/2
✗ Branch 9 → 10 not taken.
✗ Branch 9 → 15 not taken.
✗ if(result == false)
32 {
33
0/6
✗ Branch 10 → 11 not taken.
✗ Branch 10 → 28 not taken.
✗ Branch 11 → 12 not taken.
✗ Branch 11 → 26 not taken.
✗ Branch 12 → 13 not taken.
✗ Branch 12 → 24 not taken.
✗ LOG_ERR("Failed to run lax file {}", file);
34 }
35
36 ✗ return result;
37 ✗ }
38
39
40 }
41