Home | History | Annotate | Download | only in more_tests
      1 # Additional tests to run before releasing a package.
      2 #
      3 # Run like:
      4 #   make PACKAGE=/path/to/protobuf-VERSION.tar.gz
      5 #
      6 # Some of these tests require tools or make assumptions that may not be
      7 # available on end-user machines, so these cannot be part of "make check".  For
      8 # example, we test that the headers compile with strict warning settings, but
      9 # since different compilers produce wildly different warnings we cannot assume
     10 # that this test will pass everywhere.  If we ran it as part of "make check",
     11 # it could unnecessarily block users from running the real tests just because
     12 # their compiler produces some extra warnings that probably aren't a big deal.
     13 # So we run it separately. 
     14 
     15 all: header_warning_test
     16 
     17 clean:
     18 	rm -rf src target header_warning_test.cc header_warning_test.o header_warning_test
     19 
     20 # Unpack the package into src, then install it into target.
     21 PACKAGE=protobuf.tar.gz
     22 
     23 src: $(PACKAGE)
     24 	tar zxvf $(PACKAGE)
     25 	mv `basename $(PACKAGE) .tar.gz` src
     26 
     27 target: src
     28 	(cd src && ./configure --prefix=$$PWD/../target --disable-shared)
     29 	(cd src && make -j4 check)
     30 	(cd src && make install)
     31 
     32 # Verify that headers produce no warnings even under strict settings.
     33 header_warning_test.cc: target
     34 	( (cd target/include && find google/protobuf -name '*.h') | \
     35 	  awk '{print "#include \""$$1"\""} ' > header_warning_test.cc )
     36 
     37 header_warning_test: header_warning_test.cc
     38 	# TODO(kenton):  Consider adding -pedantic and -Weffc++.  Currently these
     39 	#   produce tons of extra warnings so we'll need to do some work first.
     40 	g++ -Itarget/include -Wall -Werror -Wsign-compare -O2 -c header_warning_test.cc
     41 	touch header_warning_test
     42