diff options
Diffstat (limited to 'tests/compiler/sloc-counter')
-rw-r--r-- | tests/compiler/sloc-counter/buildfile | 1 | ||||
-rw-r--r-- | tests/compiler/sloc-counter/driver.cxx | 9 | ||||
-rw-r--r-- | tests/compiler/sloc-counter/makefile | 70 | ||||
-rw-r--r-- | tests/compiler/sloc-counter/test.cxx | 5 | ||||
-rw-r--r-- | tests/compiler/sloc-counter/testscript | 1 |
5 files changed, 9 insertions, 77 deletions
diff --git a/tests/compiler/sloc-counter/buildfile b/tests/compiler/sloc-counter/buildfile index 071127c..bc84884 100644 --- a/tests/compiler/sloc-counter/buildfile +++ b/tests/compiler/sloc-counter/buildfile @@ -1,5 +1,4 @@ # file : tests/compiler/sloc-counter/buildfile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file import libs = libcutl%lib{cutl} diff --git a/tests/compiler/sloc-counter/driver.cxx b/tests/compiler/sloc-counter/driver.cxx index ecb7a69..b888d42 100644 --- a/tests/compiler/sloc-counter/driver.cxx +++ b/tests/compiler/sloc-counter/driver.cxx @@ -1,14 +1,15 @@ // file : tests/compiler/sloc-counter/driver.cxx -// copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC // license : MIT; see accompanying LICENSE file #include <fstream> #include <sstream> -#include <cassert> #include <iostream> -#include <cutl/compiler/code-stream.hxx> -#include <cutl/compiler/sloc-counter.hxx> +#include <libcutl/compiler/code-stream.hxx> +#include <libcutl/compiler/sloc-counter.hxx> + +#undef NDEBUG +#include <cassert> using namespace std; using namespace cutl::compiler; diff --git a/tests/compiler/sloc-counter/makefile b/tests/compiler/sloc-counter/makefile deleted file mode 100644 index b393c20..0000000 --- a/tests/compiler/sloc-counter/makefile +++ /dev/null @@ -1,70 +0,0 @@ -# file : tests/compiler/sloc-counter/makefile -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC -# license : MIT; see accompanying LICENSE file - -include $(dir $(lastword $(MAKEFILE_LIST)))../../../build/bootstrap.make - -cxx_tun := driver.cxx - -# -# -cxx_obj := $(addprefix $(out_base)/,$(cxx_tun:.cxx=.o)) -cxx_od := $(cxx_obj:.o=.o.d) - -cutl.l := $(out_root)/cutl/cutl.l -cutl.l.cpp-options := $(out_root)/cutl/cutl.l.cpp-options - -driver := $(out_base)/driver -test := $(out_base)/.test -clean := $(out_base)/.clean - -# Build. -# -$(driver): $(cxx_obj) $(cutl.l) -$(cxx_obj) $(cxx_od): $(cutl.l.cpp-options) - - -$(call include-dep,$(cxx_od)) - - -# Alias for default target. -# -$(out_base)/: $(driver) - - -# Test. -# -$(test): driver := $(driver) -$(test): $(driver) $(src_base)/test.cxx $(src_base)/test.std - $(call message,test $$1,$$1 $(src_base)/test.cxx | diff -u $(src_base)/test.std -,$(driver)) - - -# Clean. -# -$(clean): \ - $(driver).o.clean \ - $(addsuffix .cxx.clean,$(cxx_obj)) \ - $(addsuffix .cxx.clean,$(cxx_od)) - - -# Generated .gitignore. -# -ifeq ($(out_base),$(src_base)) -$(driver): | $(out_base)/.gitignore - -$(out_base)/.gitignore: files := driver -$(clean): $(out_base)/.gitignore.clean - -$(call include,$(bld_root)/git/gitignore.make) -endif - - -# How to. -# -$(call include,$(bld_root)/cxx/o-e.make) -$(call include,$(bld_root)/cxx/cxx-o.make) -$(call include,$(bld_root)/cxx/cxx-d.make) - -# Dependencies. -# -$(call import,$(src_root)/cutl/makefile) diff --git a/tests/compiler/sloc-counter/test.cxx b/tests/compiler/sloc-counter/test.cxx index ff0f5b2..70201ee 100644 --- a/tests/compiler/sloc-counter/test.cxx +++ b/tests/compiler/sloc-counter/test.cxx @@ -12,6 +12,9 @@ #include <iostream> +#undef NDEBUG +#include <cassert> + char str[] = "multi\ line\ string\ @@ -25,7 +28,7 @@ int main( char* argv[] /*array*/) { /* comment start */ int x = 0; - char* s = + char* s = /* comment start */"foo"; int y = 2 /* tricky stuff *// diff --git a/tests/compiler/sloc-counter/testscript b/tests/compiler/sloc-counter/testscript index 9b7eea3..7509df5 100644 --- a/tests/compiler/sloc-counter/testscript +++ b/tests/compiler/sloc-counter/testscript @@ -1,5 +1,4 @@ # file : tests/compiler/sloc-counter/testscript -# copyright : Copyright (c) 2009-2019 Code Synthesis Tools CC # license : MIT; see accompanying LICENSE file # @@ BUG: adding blank lines at the end increases the count. |