diff --git a/mkconcore.py b/mkconcore.py index a1f44ef..a7cd94d 100644 --- a/mkconcore.py +++ b/mkconcore.py @@ -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: diff --git a/tests/test_cli.py b/tests/test_cli.py index b95c60d..9562965 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -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")