public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] proj/libbash:master commit in: /, test/
@ 2011-04-12 18:29 Petteri Räty
  0 siblings, 0 replies; 3+ messages in thread
From: Petteri Räty @ 2011-04-12 18:29 UTC (permalink / raw
  To: gentoo-commits

commit:     5ce961ccc44556b4daa33f2c92a5c30ceca397dd
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Tue Apr 12 05:54:46 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Tue Apr 12 12:08:08 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=5ce961cc

Add missing tests for arithmetic

Some tests under scripts/ are missing. So we write a script to
make sure we have all *.ebuild* listed in Makefile.am.

---
 Makefile.am                 |   11 ++++++++---
 test/verify_ebuilds_test.sh |    5 +++++
 2 files changed, 13 insertions(+), 3 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index b57922d..e965bf9 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -48,9 +48,13 @@ GUNIT_TESTS = bashast/gunit/arith_main.gunit \
 
 EBUILD_LOG_COMPILER = $(srcdir)/test/script_compiler.sh
 EBUILD_TESTS = scripts/var_def.ebuild \
-			   scripts/var_expansion.ebuild
+			   scripts/var_expansion.ebuild \
+			   scripts/arithmetic_assignment.ebuild \
+			   scripts/binary_arithmetic.ebuild
 EBUILD_RESULT = scripts/var_def.ebuild.result \
-				scripts/var_expansion.ebuild.result
+				scripts/var_expansion.ebuild.result \
+				scripts/arithmetic_assignment.ebuild.result \
+				scripts/binary_arithmetic.ebuild.result
 
 TESTS = $(GUNIT_TESTS) $(EBUILD_TESTS)
 # these get cleaned so only add autogenerated stuff or modify CLEANFILES
@@ -77,7 +81,7 @@ AM_CPPFLAGS = -D_GLIBCXX_DEBUG
 endif
 
 if HAVE_GTEST
-TESTS += cppunittests test/ast_printer_test.sh
+TESTS += cppunittests test/ast_printer_test.sh test/verify_ebuilds_test.sh
 check_PROGRAMS = cppunittests variable_printer ast_printer
 
 cppunittests_SOURCES =  test/run_tests.cpp \
@@ -161,6 +165,7 @@ EXTRA_DIST = bashast/bashast.g \
 			 bashast/features_script/features.sh.ast \
 			 bashast/features_script/features.sh.tokens \
 			 test/ast_printer_test.sh \
+			 test/verify_ebuilds_test.sh \
 			 $(EBUILD_TESTS) \
 			 $(EBUILD_RESULT) \
 			 $(GUNIT_TESTS) \

diff --git a/test/verify_ebuilds_test.sh b/test/verify_ebuilds_test.sh
new file mode 100755
index 0000000..8aa84d6
--- /dev/null
+++ b/test/verify_ebuilds_test.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+num_of_ebuild_files=$(grep 'scripts/.*.ebuild' $srcdir/Makefile.am | wc -l)
+[[ $num_of_ebuild_files == $(ls $srcdir/scripts/*.ebuild* | wc -l) ]]
+exit $?



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/libbash:master commit in: /, test/
@ 2011-05-13 11:06 Petteri Räty
  0 siblings, 0 replies; 3+ messages in thread
From: Petteri Räty @ 2011-05-13 11:06 UTC (permalink / raw
  To: gentoo-commits

commit:     bb222709f19ef6b80d752fb65eef2957db079426
Author:     Petteri Räty <petsku <AT> petteriraty <DOT> eu>
AuthorDate: Fri May 13 10:47:23 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Fri May 13 11:05:31 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=bb222709

Build: compile lexer and parser as C

Now instead of compiling everything as C++ the lexer and parser are
compiled as C. This means that user supplied CFLAGS are not used for c++
code and the compiler can probably do a better job.

---
 .gitignore          |    1 -
 Makefile.am         |   47 ++++++++++++++++++++++++++++-------------------
 test/post_check.cpp |    2 +-
 3 files changed, 29 insertions(+), 21 deletions(-)

diff --git a/.gitignore b/.gitignore
index 79e3a80..60da165 100644
--- a/.gitignore
+++ b/.gitignore
@@ -40,7 +40,6 @@ bashastParser.*
 libbashLexer.*
 libbashParser.*
 libbashWalker.h
-libbashWalker.c
 libbashWalker.cpp
 libbashWalker.tokens
 *.pdf

diff --git a/Makefile.am b/Makefile.am
index f117196..7102884 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -73,12 +73,9 @@ TESTS = $(GUNIT_TESTS) $(BASH_TESTS) $(EBUILD_TESTS)
 check_JAVA = bashast/bashastLexer.java bashast/bashastParser.java
 AM_JAVACFLAGS = -source 1.4 -classpath @antlr_cp@
 
-COMMON_FLAGS = -std=c++0x -I$(top_srcdir)/src/
-# We use -x c++ to compile all C source files as C++ because there's C++
-# code embedded in them.
-# no DEVELOPER_FLAGS to as the generated files don't pass -Werror
-AM_CFLAGS = -x c++ $(COMMON_FLAGS)
-AM_CXXFLAGS = $(COMMON_FLAGS)
+AM_CXXFLAGS = -std=c++0x
+AM_CPPFLAGS = -I$(top_srcdir)/src
+
 if DEVELOPER_MODE
 # -Weffc++ seems to be giving false positives on protected non
 # virtual destructors in base classes
@@ -89,7 +86,7 @@ AM_CXXFLAGS += -Wall \
 			   -Wsign-promo \
 			   -pedantic-errors \
 			   -Werror
-AM_CPPFLAGS = -D_GLIBCXX_DEBUG
+AM_CPPFLAGS += -D_GLIBCXX_DEBUG
 endif
 
 if HAVE_GTEST
@@ -140,20 +137,22 @@ instruo_CXXFLAGS = $(AM_CXXFLAGS) -Wno-extra
 ast_printer_SOURCES = utils/ast_printer.cpp
 ast_printer_LDADD = libcppbash.la $(BOOST_PROGRAM_OPTIONS_LIB)
 ast_printer_LDFLAGS = -static
-ast_printer_CPPFLAGS = $(BOOST_CPPFLAGS)
+# boost is probably compiled without debug STL so if that is used
+# linking will fail
+ast_printer_CPPFLAGS = $(AM_CPPFLAGS) -U_GLIBCXX_DEBUG $(BOOST_CPPFLAGS)
 
 GENERATED_PARSER_C = libbashLexer.c libbashParser.c
 GENERATED_PARSER_H = libbashLexer.h libbashParser.h
-GENERATED_WALKER_C = libbashWalker.c
+GENERATED_WALKER_CPP = libbashWalker.cpp
 GENERATED_WALKER_H = libbashWalker.h
 BUILT_SOURCES = $(GENERATED_PARSER_C) \
 				$(GENERATED_PARSER_H) \
-				$(GENERATED_WALKER_C) \
+				$(GENERATED_WALKER_CPP) \
 				$(GENERATED_WALKER_H) \
 				$(check_JAVA)
 CLEANFILES = $(GENERATED_PARSER_C) \
 			 $(GENERATED_PARSER_H) \
-			 $(GENERATED_WALKER_C) \
+			 $(GENERATED_WALKER_CPP) \
 			 $(GENERATED_WALKER_H) \
 			 $(check_JAVA) \
 			 libbash.g \
@@ -189,15 +188,24 @@ libcppbash_la_SOURCES = src/common.h \
 						src/core/interpreter.h \
 						src/core/symbols.hpp \
 						src/core/bash_ast.cpp \
-						src/core/bash_ast.h \
-						$(GENERATED_WALKER_C) \
-						$(GENERATED_WALKER_H)
+						src/core/bash_ast.h
+
+# separate library because we need per file CXXFLAGS
+# as antlr generated code does not pass our strict developer
+# warning settings
+noinst_LTLIBRARIES = libwalker.la
+libwalker_la_SOURCES = $(GENERATED_WALKER_CPP) \
+					   $(GENERATED_WALKER_H)
 
-HIDDEN_FLAGS = -fvisibility=hidden \
-			   -fvisibility-inlines-hidden
+libwalker_la_CXXFLAGS = -std=c++0x \
+						-fvisibility=hidden \
+						-fvisibility-inlines-hidden
 
-libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) $(HIDDEN_FLAGS)
-libcppbash_la_CFLAGS = $(AM_CFLAGS) $(HIDDEN_FLAGS)
+libcppbash_la_CXXFLAGS = $(AM_CXXFLAGS) \
+						 -fvisibility=hidden \
+						 -fvisibility-inlines-hidden
+libcppbash_la_CFLAGS = $(AM_CFLAGS) -fvisibility=hidden
+libcppbash_la_LIBADD = libwalker.la
 
 EXTRA_DIST = bashast/bashast.g \
 			 bashast/libbashWalker.g \
@@ -242,12 +250,13 @@ walker.run: bashast/libbashWalker.g cgrammar.run
 	$(AM_V_at)touch $@.tmp
 	$(AM_V_GEN)$(ANTLR) -fo . $<
 	$(AM_V_at)sed -i -e 's/\(libbash_.*\) = NULL/\1/' libbashWalker.c
+	$(AM_V_at)mv libbashWalker.{c,cpp}
 	$(AM_V_at)mv $@.tmp $@
 
 $(GENERATED_PARSER_C): cgrammar.run
 $(GENERATED_PARSER_H): cgrammar.run
 
-$(GENERATED_WALKER_C): walker.run
+$(GENERATED_WALKER_CPP): walker.run
 $(GENERATED_WALKER_H): walker.run
 
 javagrammar.run: bashast/bashast.g

diff --git a/test/post_check.cpp b/test/post_check.cpp
index e1f1a1a..f7feebd 100644
--- a/test/post_check.cpp
+++ b/test/post_check.cpp
@@ -46,5 +46,5 @@ TEST(post_check, parser_size)
 
 TEST(post_check, walker_size)
 {
-  check_file_size("libbashWalker.c", 4096 * 1024);
+  check_file_size("libbashWalker.cpp", 4096 * 1024);
 }



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] proj/libbash:master commit in: /, test/
@ 2011-08-04 14:24 Petteri Räty
  0 siblings, 0 replies; 3+ messages in thread
From: Petteri Räty @ 2011-08-04 14:24 UTC (permalink / raw
  To: gentoo-commits

commit:     50d971dace5e40e4ed08ca1fdc835d9b016635b3
Author:     Mu Qiao <qiaomuf <AT> gentoo <DOT> org>
AuthorDate: Thu Aug  4 09:01:11 2011 +0000
Commit:     Petteri Räty <betelgeuse <AT> gentoo <DOT> org>
CommitDate: Thu Aug  4 14:15:15 2011 +0000
URL:        http://git.overlays.gentoo.org/gitweb/?p=proj/libbash.git;a=commit;h=50d971da

Test: move test_coverage.sh to test/

---
 Makefile.am                               |    4 ++--
 test_coverage.sh => test/test_coverage.sh |    0
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 3ca0e08..cbc9f3b 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -313,7 +313,7 @@ EXTRA_DIST = bashast/bashast.g \
 			 scripts/bar.eclass \
 			 utils/metadata_diff.sh \
 			 utils/isolated-functions.sh \
-			 test_coverage.sh \
+			 test/test_coverage.sh \
 			 autogen.sh \
 			 $(BASH_TESTS) \
 			 $(EBUILD_TESTS) \
@@ -402,5 +402,5 @@ benchmark_parser: callgrind.out
 	callgrind_annotate callgrind.out
 
 test_coverage: dist
-	MAKE=$(MAKE) DIST_ARCHIVES=$(DIST_ARCHIVES) ./test_coverage.sh
+	MAKE=$(MAKE) DIST_ARCHIVES=$(DIST_ARCHIVES) test/test_coverage.sh
 	rm $(DIST_ARCHIVES)

diff --git a/test_coverage.sh b/test/test_coverage.sh
similarity index 100%
rename from test_coverage.sh
rename to test/test_coverage.sh



^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-08-04 14:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-04-12 18:29 [gentoo-commits] proj/libbash:master commit in: /, test/ Petteri Räty
  -- strict thread matches above, loose matches on Subject: below --
2011-05-13 11:06 Petteri Räty
2011-08-04 14:24 Petteri Räty

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox