From db660521fa05b9e2f6f83e0daa1ade23cb438f62 Mon Sep 17 00:00:00 2001 From: Andrew Hamilton Date: Tue, 9 Feb 2016 21:44:12 +0000 Subject: [PATCH] Added tests for c++ tools. --- golden-files/input/hello.cpp | 8 ++++++++ golden-files/results/bcpp-hello_cpp | 9 +++++++++ golden-files/results/uncrustify-hello_cpp | 9 +++++++++ tools_test.py | 7 ++++++- 4 files changed, 32 insertions(+), 1 deletion(-) create mode 100644 golden-files/input/hello.cpp create mode 100644 golden-files/results/bcpp-hello_cpp create mode 100644 golden-files/results/uncrustify-hello_cpp diff --git a/golden-files/input/hello.cpp b/golden-files/input/hello.cpp new file mode 100644 index 0000000..d36f6e6 --- /dev/null +++ b/golden-files/input/hello.cpp @@ -0,0 +1,8 @@ +#include + +using namespace std; + +int main() +{ + cout << "Hello World" << endl; +} diff --git a/golden-files/results/bcpp-hello_cpp b/golden-files/results/bcpp-hello_cpp new file mode 100644 index 0000000..d8e111a --- /dev/null +++ b/golden-files/results/bcpp-hello_cpp @@ -0,0 +1,9 @@ +#include  + +using namespace std; + +int main() +{ + cout << "Hello World" << endl; +} +  \ No newline at end of file diff --git a/golden-files/results/uncrustify-hello_cpp b/golden-files/results/uncrustify-hello_cpp new file mode 100644 index 0000000..d8e111a --- /dev/null +++ b/golden-files/results/uncrustify-hello_cpp @@ -0,0 +1,9 @@ +#include  + +using namespace std; + +int main() +{ + cout << "Hello World" << endl; +} +  \ No newline at end of file diff --git a/tools_test.py b/tools_test.py index 43b7c9e..8c414b0 100755 --- a/tools_test.py +++ b/tools_test.py @@ -123,7 +123,8 @@ class ToolsTestCase(unittest.TestCase): self._sub_tests([ (tools.uncrustify, "closure-util.java", tools.Status.problem), (tools.uncrustify, "hello.c", tools.Status.normal), - (tools.uncrustify, "hello.h", tools.Status.normal)]) + (tools.uncrustify, "hello.h", tools.Status.normal), + (tools.uncrustify, "hello.cpp", tools.Status.normal)]) def test_splint(self): self._sub_tests([(tools.splint, "hello.c", tools.Status.ok), @@ -141,6 +142,10 @@ class ToolsTestCase(unittest.TestCase): self._sub_tests([ (tools.html2text, "hi.html", tools.Status.normal)]) + def test_bcpp(self): + self._sub_tests([ + (tools.bcpp, "hello.cpp", tools.Status.normal)]) + if __name__ == "__main__": golden.main()