def test_compile(self, tmpdir): tmp_path = str(tmpdir) localfilename = "helloworld" with open(os.path.join(tmp_path, localfilename+".cpp"), "w") as source: source.write(self.cpp_hello_world) _wrapper._compile(tmp_path, localfilename, localfilename) assert os.path.exists(os.path.join(tmp_path, localfilename+".out"))
def test_compile(self, tmpdir): tmp_path = str(tmpdir) localfilename = "helloworld" with open(os.path.join(tmp_path, localfilename + ".cpp"), "w") as source: source.write(self.cpp_hello_world) _wrapper._compile(tmp_path, localfilename, localfilename) assert os.path.exists(os.path.join(tmp_path, localfilename + ".out"))
def test_compile_invalid(self, tmpdir): tmp_path = str(tmpdir) localfilename = "invalid" with open(os.path.join(tmp_path, localfilename+".cpp"), "w") as source: source.write("invalid") try: _wrapper._compile(tmp_path, localfilename, localfilename) pytest.fail("Source can't be compiled!") except Exception: assert True
def test_compile_invalid(self, tmpdir): tmp_path = str(tmpdir) localfilename = "invalid" with open(os.path.join(tmp_path, localfilename + ".cpp"), "w") as source: source.write("invalid") try: _wrapper._compile(tmp_path, localfilename, localfilename) pytest.fail("Source can't be compiled!") except Exception: assert True