Skip to content

Commit

Permalink
Merge pull request #125 from orbea/tinyformat
Browse files Browse the repository at this point in the history
Replace the tinyformat submodule with a git subtree
  • Loading branch information
Kingcom committed Nov 19, 2017
2 parents 0cf6fdc + 2fef04f commit 8b4cada
Show file tree
Hide file tree
Showing 10 changed files with 2,007 additions and 4 deletions.
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

1 change: 0 additions & 1 deletion ext/tinyformat
Submodule tinyformat deleted from b7f5a2
3 changes: 3 additions & 0 deletions ext/tinyformat/.gitignore
@@ -0,0 +1,3 @@
_bloat_test_tmp*
tinyformat_test_cxx*
tinyformat_speed_test
56 changes: 56 additions & 0 deletions ext/tinyformat/Makefile
@@ -0,0 +1,56 @@
# Build and run the unit tests (or speed tests) on linux
#
# Should work with recent versions of both gcc and clang. (To compile with
# clang use "make CXX=clang++".)

CXXFLAGS?=-Wall
CXX11FLAGS?=-std=c++0x

test: tinyformat_test_cxx98 tinyformat_test_cxx11
@echo running tests...
@./tinyformat_test_cxx98 && \
./tinyformat_test_cxx11 && \
! $(CXX) $(CXXFLAGS) -std=c++98 -DTINYFORMAT_NO_VARIADIC_TEMPLATES \
-DTEST_WCHAR_T_COMPILE tinyformat_test.cpp 2> /dev/null && \
echo "No errors" || echo "Tests failed"

doc: tinyformat.html

speed_test: tinyformat_speed_test
@echo running speed tests...
@echo printf timings:
@time -p ./tinyformat_speed_test printf > /dev/null
@echo iostreams timings:
@time -p ./tinyformat_speed_test iostreams > /dev/null
@echo tinyformat timings:
@time -p ./tinyformat_speed_test tinyformat > /dev/null
@echo boost timings:
@time -p ./tinyformat_speed_test boost > /dev/null

tinyformat_test_cxx98: tinyformat.h tinyformat_test.cpp Makefile
$(CXX) $(CXXFLAGS) -std=c++98 -DTINYFORMAT_NO_VARIADIC_TEMPLATES tinyformat_test.cpp -o tinyformat_test_cxx98

tinyformat_test_cxx11: tinyformat.h tinyformat_test.cpp Makefile
$(CXX) $(CXXFLAGS) $(CXX11FLAGS) -DTINYFORMAT_USE_VARIADIC_TEMPLATES tinyformat_test.cpp -o tinyformat_test_cxx11

tinyformat.html: README.rst
@echo building docs...
rst2html.py README.rst > tinyformat.html

tinyformat_speed_test: tinyformat.h tinyformat_speed_test.cpp Makefile
$(CXX) $(CXXFLAGS) -O3 -DNDEBUG tinyformat_speed_test.cpp -o tinyformat_speed_test

bloat_test:
@for opt in '' '-O3 -DNDEBUG' ; do \
for use in '' '-DUSE_IOSTREAMS' '-DUSE_TINYFORMAT' '-DUSE_TINYFORMAT $(CXX11FLAGS)' '-DUSE_BOOST' ; do \
echo ; \
echo ./bloat_test.sh $(CXX) $$opt $$use ; \
./bloat_test.sh $(CXX) $$opt $$use ; \
done ; \
done


clean:
rm -f tinyformat_test_cxx98 tinyformat_test_cxx11 tinyformat_speed_test
rm -f tinyformat.html
rm -f _bloat_test_tmp_*
12 changes: 12 additions & 0 deletions ext/tinyformat/Makefile.nmake
@@ -0,0 +1,12 @@
# Build and run the unit tests on windows with MSVC.
#
# To use, open a visual studio command prompt and type
#
# nmake -f Makefile.nmake

test: tinyformat_test_cxx98
@echo running tests...
@tinyformat_test_cxx98 && echo "No errors"

tinyformat_test_cxx98: tinyformat.h tinyformat_test.cpp
cl -W3 -EHsc -DTINYFORMAT_NO_VARIADIC_TEMPLATES tinyformat_test.cpp -Fetinyformat_test_cxx98

0 comments on commit 8b4cada

Please sign in to comment.