Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions mkconcore.py
Original file line number Diff line number Diff line change
Expand Up @@ -732,6 +732,14 @@ def cleanup_script_files():
with open(outdir+"/src/concore_oport.m","w") as fcopy: fcopy.write(fsource.read())
fsource.close()

fsource = open(CONCOREPATH+"/concore_literal_eval.m")
with open(outdir+"/src/concore_literal_eval.m","w") as fcopy: fcopy.write(fsource.read())
fsource.close()

fsource = open(CONCOREPATH+"/concore_literal_serialize.m")
with open(outdir+"/src/concore_literal_serialize.m","w") as fcopy: fcopy.write(fsource.read())
fsource.close()

if concoretype=="docker":
fsource = open(CONCOREPATH+"/import_concoredocker.m")
else:
Expand Down
28 changes: 28 additions & 0 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1016,6 +1016,34 @@ def test_inspect_invalid_graphml_exits_nonzero(self):
self.assertEqual(result.exit_code, 1)
self.assertIn("Not a valid GraphML file", result.output)

def test_build_command_m_node_copies_literal_helpers(self):
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
result = self.runner.invoke(cli, ["init", "test-project"])
self.assertEqual(result.exit_code, 0)

Path("test-project/src/script.py").rename("test-project/src/script.m")
workflow_path = Path("test-project/workflow.graphml")
content = workflow_path.read_text()
workflow_path.write_text(content.replace("N1:script.py", "N1:script.m"))

result = self.runner.invoke(
cli,
[
"build",
"test-project/workflow.graphml",
"--source",
"test-project/src",
"--output",
"out",
"--type",
"posix",
],
)
self.assertEqual(result.exit_code, 0)
# concore_read.m / concore_write.m call these helpers
self.assertTrue(Path("out/src/concore_literal_eval.m").exists())
self.assertTrue(Path("out/src/concore_literal_serialize.m").exists())

def test_watch_file_instead_of_dir_exits_nonzero(self):
with self.runner.isolated_filesystem(temp_dir=self.temp_dir):
Path("notes.txt").write_text("hi")
Expand Down
Loading