def test_UnpackResult_clgen_result(clgen_result: deepsmith_pb2.Result): """Unpacking a CLgen result creates expected files.""" result_dir = clgen_result.parent opencl_fuzz.UnpackResult(str(clgen_result)) assert (result_dir / 'stdout.txt').is_file() assert (result_dir / 'stderr.txt').is_file() assert (result_dir / 'kernel.cl').is_file() assert (result_dir / 'driver.c').is_file()
def test_UnpackResult_clsmith_result(clsmith_result: deepsmith_pb2.Result): """Unpacking a CLSmith result creates expected files.""" result_dir = clsmith_result.parent opencl_fuzz.UnpackResult(str(clsmith_result)) assert (result_dir / "stdout.txt").is_file() assert (result_dir / "stderr.txt").is_file() assert (result_dir / "kernel.cl").is_file() assert (result_dir / "driver.c").is_file()
def test_UnpackResult_no_result(): """An error raised if no result to unpack is provided.""" with pytest.raises(app.UsageError): opencl_fuzz.UnpackResult(None) with pytest.raises(app.UsageError): opencl_fuzz.UnpackResult('')