Example #1
0
 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"))
Example #2
0
    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"))
Example #3
0
 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        
Example #4
0
    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