add tests to double-conversion.mk

- tests can be run all at once by just calling
  double-conversion-tester.com, but running separately for speed
- all tests pass in MODE=
This commit is contained in:
ahgamut 2022-06-24 13:17:47 +05:30
parent 3d30dcd204
commit f990ccee72
2 changed files with 105 additions and 3 deletions

View file

@ -4,13 +4,45 @@
PKGS += THIRD_PARTY_DOUBLECONVERSION
THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS += THIRD_PARTY_DOUBLECONVERSION_A
THIRD_PARTY_DOUBLECONVERSION = $(THIRD_PARTY_DOUBLECONVERSION_A_DEPS) $(THIRD_PARTY_DOUBLECONVERSION_A)
THIRD_PARTY_DOUBLECONVERSION = $(THIRD_PARTY_DOUBLECONVERSION_A_DEPS) \
$(THIRD_PARTY_DOUBLECONVERSION_A)
THIRD_PARTY_DOUBLECONVERSION_A = o/$(MODE)/third_party/double-conversion/libdouble-conversion.a
THIRD_PARTY_DOUBLECONVERSION_A_FILES := $(wildcard third_party/double-conversion/*)
THIRD_PARTY_DOUBLECONVERSION_A_SRCS_CC = $(filter %.cc,$(THIRD_PARTY_DOUBLECONVERSION_A_FILES))
THIRD_PARTY_DOUBLECONVERSION_A_HDRS = $(filter %.h,$(THIRD_PARTY_DOUBLECONVERSION_A_FILES))
THIRD_PARTY_DOUBLECONVERSION_TEST_COMS = \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
THIRD_PARTY_DOUBLECONVERSION_TEST_BINS = \
$(THIRD_PARTY_DOUBLECONVERSION_TEST_COMS) \
$(THIRD_PARTY_DOUBLECONVERSION_TEST_COMS:%=%.dbg)
THIRD_PARTY_DOUBLECONVERSION_TEST_A_SRCS_CC = \
third_party/double-conversion/test/cctest.cc \
third_party/double-conversion/test/gay-fixed.cc \
third_party/double-conversion/test/gay-precision.cc \
third_party/double-conversion/test/gay-shortest.cc \
third_party/double-conversion/test/gay-shortest-single.cc \
third_party/double-conversion/test/test-bignum.cc \
third_party/double-conversion/test/test-bignum-dtoa.cc \
third_party/double-conversion/test/test-conversions.cc \
third_party/double-conversion/test/test-diy-fp.cc \
third_party/double-conversion/test/test-dtoa.cc \
third_party/double-conversion/test/test-fast-dtoa.cc \
third_party/double-conversion/test/test-fixed-dtoa.cc \
third_party/double-conversion/test/test-ieee.cc \
third_party/double-conversion/test/test-strtod.cc
THIRD_PARTY_DOUBLECONVERSION_TEST_A_HDRS = \
third_party/double-conversion/test/cctest.h \
third_party/double-conversion/test/checks.h \
third_party/double-conversion/test/gay-fixed.h \
third_party/double-conversion/test/gay-precision.h \
third_party/double-conversion/test/gay-shortest.h \
third_party/double-conversion/test/gay-shortest-single.h
THIRD_PARTY_DOUBLECONVERSION_A_OBJS = \
$(THIRD_PARTY_DOUBLECONVERSION_A_SRCS_CC:%.cc=o/$(MODE)/%.o)
@ -18,6 +50,9 @@ THIRD_PARTY_DOUBLECONVERSION_A_CHECKS = \
$(THIRD_PARTY_DOUBLECONVERSION_A).pkg \
$(THIRD_PARTY_DOUBLECONVERSION_A_HDRS:%=o/$(MODE)/%.okk)
THIRD_PARTY_DOUBLECONVERSION_TEST_A_OBJS = \
$(THIRD_PARTY_DOUBLECONVERSION_TEST_A_SRCS_CC:%.cc=o/$(MODE)/%.o)
THIRD_PARTY_DOUBLECONVERSION_A_DIRECTDEPS = \
LIBC_INTRIN \
LIBC_NEXGEN32E \
@ -29,6 +64,7 @@ THIRD_PARTY_DOUBLECONVERSION_A_DIRECTDEPS = \
LIBC_SYSV \
LIBC_STR \
LIBC_STUBS \
LIBC_UNICODE \
LIBC_TINYMATH \
THIRD_PARTY_GDTOA \
THIRD_PARTY_LIBCXX
@ -50,6 +86,70 @@ $(THIRD_PARTY_DOUBLECONVERSION_A_OBJS): \
-ffunction-sections \
-fdata-sections
$(THIRD_PARTY_DOUBLECONVERSION_TEST_A_OBJS): \
OVERRIDE_CXXFLAGS += \
-DSTACK_FRAME_UNLIMITED \
-ffunction-sections \
-fdata-sections
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com.dbg: \
$(THIRD_PARTY_DOUBLECONVERSION_A_DEPS) \
$(THIRD_PARTY_DOUBLECONVERSION_A) \
$(THIRD_PARTY_DOUBLECONVERSION_TEST_A_OBJS) \
$(CRT) \
$(APE_NO_MODIFY_SELF)
@$(APELINK)
THIRD_PARTY_DOUBLECONVERSION_TEST_NAMES = \
test-strtod \
test-ieee \
test-fixed-dtoa \
test-fast-dtoa \
test-dtoa \
test-diy-fp \
test-conversions \
test-bignum-dtoa \
test-bignum
THIRD_PARTY_DOUBLECONVERSION_TEST_RUNS = \
$(THIRD_PARTY_DOUBLECONVERSION_TEST_NAMES:%=o/$(MODE)/third_party/double-conversion/%.runs)
o/$(MODE)/third_party/double-conversion/test-strtod.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-strtod
o/$(MODE)/third_party/double-conversion/test-ieee.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-ieee
o/$(MODE)/third_party/double-conversion/test-fixed-dtoa.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-fixed-dtoa
o/$(MODE)/third_party/double-conversion/test-fast-dtoa.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-fast-dtoa
o/$(MODE)/third_party/double-conversion/test-dtoa.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-dtoa
o/$(MODE)/third_party/double-conversion/test-diy-fp.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-diy-fp
o/$(MODE)/third_party/double-conversion/test-conversions.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-conversions
o/$(MODE)/third_party/double-conversion/test-bignum-dtoa.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-bignum-dtoa
o/$(MODE)/third_party/double-conversion/test-bignum.runs: \
o/$(MODE)/third_party/double-conversion/double-conversion-tester.com
@$(COMPILE) -ACHECK -tT$@ $< test-bignum
THIRD_PARTY_DOUBLECONVERSION_LIBS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)))
THIRD_PARTY_DOUBLECONVERSION_SRCS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)_SRCS))
THIRD_PARTY_DOUBLECONVERSION_HDRS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)_HDRS))
@ -57,4 +157,6 @@ THIRD_PARTY_DOUBLECONVERSION_CHECKS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION
THIRD_PARTY_DOUBLECONVERSION_OBJS = $(foreach x,$(THIRD_PARTY_DOUBLECONVERSION_ARTIFACTS),$($(x)_OBJS))
.PHONY: o/$(MODE)/third_party/double-conversion
o/$(MODE)/third_party/double-conversion: $(THIRD_PARTY_DOUBLECONVERSION_CHECKS)
o/$(MODE)/third_party/double-conversion: \
$(THIRD_PARTY_DOUBLECONVERSION_CHECKS) \
$(THIRD_PARTY_DOUBLECONVERSION_TEST_RUNS)

View file

@ -26,7 +26,7 @@
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "libc/isystem/stdlib.h"
#include "libc/isystem/limits"
#include "third_party/libcxx/limits"
#include "third_party/double-conversion/test/cctest.h"
#include "third_party/double-conversion/diy-fp.h"