def test_ClangPreprocess_small_cxx_program(): """Test pre-processing a small C++ program.""" assert cxx.ClangPreprocess(""" #define FOO T template<typename FOO> FOO foobar(const T& a) {return a;} int foo() { return foobar<int>(10); } """) == """
def test_ClangPreprocess_missing_include(): """Test that ClangPreprocessor error is raised on missing #include.""" with test.Raises(errors.ClangException) as e_info: cxx.ClangPreprocess('#include "my-missing-file.h"') assert "'my-missing-file.h' file not found" in str(e_info.value)
def test_ClangPreprocess_empty_input(): """Test that ClangPreprocess accepts an empty input.""" assert cxx.ClangPreprocess("") == "\n"