• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

ossia / score / 35310244323

18 Sep 2026 05:17AM UTC coverage: 39.902% (+2.2%) from 37.724%
35310244323

push

github

jcelerier
tests: include CommandDispatcher where JsLibraryScriptSavingTest uses it

ee4b67af6f added the test with a CommandDispatcher<> but without its header,
relying on it arriving transitively. The Coverage build compiles with clang-19
at gnu++23 and does not get it that way:

  JsLibraryScriptSavingTest.cpp:70:3: error: no template named 'CommandDispatcher'

This has been broken since 2026-09-13 and was hidden behind the boost download
failure, which stopped that job before it ever reached the compile.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01K1e2ZdUQh7Srmv6BGVakrQ

114906 of 287968 relevant lines covered (39.9%)

77906.02 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

97.06
/src/plugins/score-plugin-js/JS/JSProcessModelSerialization.cpp
1
// This is an open source non-commercial project. Dear PVS-Studio, please check
2
// it. PVS-Studio Static Code Analyzer for C, C++ and C#: http://www.viva64.com
3
#include "JSProcessModel.hpp"
4

5
#include <Process/Dataflow/Port.hpp>
6
#include <Process/Dataflow/PortFactory.hpp>
7

8
#include <score/application/ApplicationComponents.hpp>
9
#include <score/serialization/DataStreamVisitor.hpp>
10
#include <score/serialization/JSONValueVisitor.hpp>
11
#include <score/serialization/JSONVisitor.hpp>
12
#include <score/tools/FilePath.hpp>
13

14
#include <QString>
15

16
template <>
17
void DataStreamReader::read(const JS::QmlSource& p)
52✔
18
{
19
  m_stream << p.execution << p.ui;
52✔
20
}
52✔
21

22
template <>
23
void DataStreamWriter::write(JS::QmlSource& p)
3✔
24
{
25
  m_stream >> p.execution >> p.ui;
3✔
26
}
3✔
27

28
template <>
29
void DataStreamReader::read(const JS::ProcessModel& proc)
10✔
30
{
31
  auto& ctx = score::IDocument::documentContext(proc);
10✔
32
  // A script still identical to the .qml it came from travels as that path
33
  // alone: embedding a copy would freeze the document on today's version of a
34
  // library file the user expects to keep receiving updates for.
35
  m_stream << (proc.followsRootFile() ? JS::QmlSource{} : proc.m_program) << proc.m_state
20✔
36
           << score::relativizeFilePath(proc.m_root, ctx);
10✔
37

38
  readPorts(*this, proc.m_inlets, proc.m_outlets);
10✔
39

40
  insertDelimiter();
10✔
41
}
10✔
42

43
template <>
44
void DataStreamWriter::write(JS::ProcessModel& proc)
3✔
45
{
46
  JS::QmlSource str;
3✔
47
  JS::JSState st;
3✔
48
  m_stream >> str >> st >> proc.m_root;
3✔
49
  if(!proc.m_root.isEmpty())
3✔
50
  {
51
    auto& ctx = score::IDocument::documentContext(proc);
1✔
52
    proc.m_root = score::locateFilePath(proc.m_root, ctx);
1✔
53
    if(str.execution.isEmpty())
1✔
54
      str = JS::ProcessModel::readProgramFromFile(proc.m_root);
1✔
55
  }
1✔
56
  proc.setState(st);
3✔
57
  (void)proc.setProgram(str);
3✔
58

59
  writePorts(
3✔
60
      *this, components.interfaces<Process::PortFactoryList>(), proc.m_inlets,
3✔
61
      proc.m_outlets, &proc);
3✔
62

63
  checkDelimiter();
3✔
64
}
3✔
65

66
template <>
67
void JSONReader::read(const JS::ProcessModel& proc)
8✔
68
{
69
  // A script still identical to the .qml it came from travels as that path
70
  // alone: embedding a copy would freeze the document on today's version of a
71
  // library file the user expects to keep receiving updates for.
72
  if(!proc.followsRootFile())
8✔
73
  {
74
    obj["Script"] = proc.program().execution;
6✔
75
    if(const auto& ui = proc.program().ui; !ui.isEmpty())
6✔
76
      obj["Ui"] = ui;
2✔
77
  }
6✔
78
  if(const auto& st = proc.state(); !st.empty())
8✔
79
    obj["State"] = st;
×
80
  if(const auto& r = proc.m_root; !r.isEmpty())
8✔
81
  {
82
    auto& ctx = score::IDocument::documentContext(proc);
4✔
83
    obj["Root"] = score::relativizeFilePath(proc.m_root, ctx);
4✔
84
  }
4✔
85
  readPorts(*this, proc.m_inlets, proc.m_outlets);
8✔
86
}
8✔
87

88
template <>
89
void JSONWriter::write(JS::ProcessModel& proc)
5✔
90
{
91
  JS::QmlSource p;
5✔
92
  JS::JSState st;
5✔
93
  if(auto script = obj.tryGet("Script"))
5✔
94
    p.execution = script->toString();
4✔
95

96
  if(auto ui = obj.tryGet("Ui"))
5✔
97
    p.ui = ui->toString();
1✔
98

99
  if(auto json_st = obj.tryGet("State"))
5✔
100
    st <<= *json_st;
×
101

102
  if(auto json_r = obj.tryGet("Root"))
5✔
103
  {
104
    proc.m_root <<= *json_r;
2✔
105
    if(!proc.m_root.isEmpty())
2✔
106
    {
107
      auto& ctx = score::IDocument::documentContext(proc);
2✔
108
      proc.m_root = score::locateFilePath(proc.m_root, ctx);
2✔
109
      // Saved as a path alone: the file is the script.
110
      if(p.execution.isEmpty())
2✔
111
        p = JS::ProcessModel::readProgramFromFile(proc.m_root);
1✔
112
    }
2✔
113
  }
2✔
114

115
  proc.setState(st);
5✔
116
  (void)proc.setProgram(p);
5✔
117

118
  writePorts(
5✔
119
      *this, components.interfaces<Process::PortFactoryList>(), proc.m_inlets,
5✔
120
      proc.m_outlets, &proc);
5✔
121
}
5✔
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE TRIAL · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc