From be095014187fbe40e91e6b45166e9f2b3530123a Mon Sep 17 00:00:00 2001 From: Karen Arutyunov Date: Tue, 15 Nov 2016 22:47:30 +0300 Subject: Add support for build2 for tests --- tests/compiler/sloc-counter/buildfile | 7 ++++++ tests/compiler/sloc-counter/driver.cxx | 2 +- tests/compiler/sloc-counter/testscript | 46 ++++++++++++++++++++++++++++++++++ 3 files changed, 54 insertions(+), 1 deletion(-) create mode 100644 tests/compiler/sloc-counter/buildfile create mode 100644 tests/compiler/sloc-counter/testscript (limited to 'tests/compiler/sloc-counter') diff --git a/tests/compiler/sloc-counter/buildfile b/tests/compiler/sloc-counter/buildfile new file mode 100644 index 0000000..e84c722 --- /dev/null +++ b/tests/compiler/sloc-counter/buildfile @@ -0,0 +1,7 @@ +# file : tests/compiler/sloc-counter/buildfile +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +import libs = libcutl%lib{cutl} + +exe{driver}: cxx{driver} $libs test{testscript} diff --git a/tests/compiler/sloc-counter/driver.cxx b/tests/compiler/sloc-counter/driver.cxx index 504fbb7..9d738b3 100644 --- a/tests/compiler/sloc-counter/driver.cxx +++ b/tests/compiler/sloc-counter/driver.cxx @@ -22,7 +22,7 @@ main (int argc, char* argv[]) ostream_filter filt (cout); - ifstream ifs(argv[1]); + ifstream ifs (argv[1]); for (istream::int_type c (ifs.get ()); c != istream::traits_type::eof (); diff --git a/tests/compiler/sloc-counter/testscript b/tests/compiler/sloc-counter/testscript new file mode 100644 index 0000000..802d406 --- /dev/null +++ b/tests/compiler/sloc-counter/testscript @@ -0,0 +1,46 @@ +# file : tests/compiler/sloc-counter/testscript +# copyright : Copyright (c) 2009-2013 Code Synthesis Tools CC +# license : MIT; see accompanying LICENSE file + +: c++-program-sloc +: +text = '// C++ comment + // C++ comment + +/* C comment */ + +/* Multiline + C + Comment + + +*/ + +#include + +char str[] = "multi\ +line\ +string\ +literal"; + +using namespace std; + + +int main( + int argc /*count*/, + char* argv[] /*array*/) +{ + /* comment start */ int x = 0; + char* s = + /* comment start */"foo"; + int y = 2 + /* tricky stuff *// + 2; + cerr << "Hello, \"world!" << '"'\\''"' << endl; +}'; +cat <"$text" >>>file; +$* file >>EOO +$text + +18 +EOO -- cgit v1.1