mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-23 05:42:29 +00:00
Fold conv package into fmt
Both packages had nearly identical dependency requirements, so merging them should help reduce the complexity of the build graph.
This commit is contained in:
parent
978b7858f9
commit
1fc91f3580
203 changed files with 352 additions and 563 deletions
|
@ -1,64 +0,0 @@
|
|||
#-*-mode:makefile-gmake;indent-tabs-mode:t;tab-width:8;coding:utf-8-*-┐
|
||||
#───vi: set et ft=make ts=8 tw=8 fenc=utf-8 :vi───────────────────────┘
|
||||
|
||||
PKGS += TEST_LIBC_CONV
|
||||
|
||||
TEST_LIBC_CONV_SRCS := $(wildcard test/libc/conv/*.c)
|
||||
TEST_LIBC_CONV_SRCS_TEST = $(filter %_test.c,$(TEST_LIBC_CONV_SRCS))
|
||||
|
||||
TEST_LIBC_CONV_OBJS = \
|
||||
$(TEST_LIBC_CONV_SRCS:%=o/$(MODE)/%.zip.o) \
|
||||
$(TEST_LIBC_CONV_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
||||
TEST_LIBC_CONV_COMS = \
|
||||
$(TEST_LIBC_CONV_SRCS:%.c=o/$(MODE)/%.com)
|
||||
|
||||
TEST_LIBC_CONV_BINS = \
|
||||
$(TEST_LIBC_CONV_COMS) \
|
||||
$(TEST_LIBC_CONV_COMS:%=%.dbg)
|
||||
|
||||
TEST_LIBC_CONV_TESTS = \
|
||||
$(TEST_LIBC_CONV_SRCS_TEST:%.c=o/$(MODE)/%.com.ok)
|
||||
|
||||
TEST_LIBC_CONV_CHECKS = \
|
||||
$(TEST_LIBC_CONV_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
|
||||
|
||||
TEST_LIBC_CONV_DIRECTDEPS = \
|
||||
LIBC_CONV \
|
||||
LIBC_FMT \
|
||||
LIBC_LOG \
|
||||
LIBC_MEM \
|
||||
LIBC_STDIO \
|
||||
LIBC_NEXGEN32E \
|
||||
LIBC_STUBS \
|
||||
LIBC_TINYMATH \
|
||||
LIBC_RUNTIME \
|
||||
LIBC_X \
|
||||
LIBC_TESTLIB
|
||||
|
||||
TEST_LIBC_CONV_DEPS := \
|
||||
$(call uniq,$(foreach x,$(TEST_LIBC_CONV_DIRECTDEPS),$($(x))))
|
||||
|
||||
o/$(MODE)/test/libc/conv/conv.pkg: \
|
||||
$(TEST_LIBC_CONV_OBJS) \
|
||||
$(foreach x,$(TEST_LIBC_CONV_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/test/libc/conv/%.com.dbg: \
|
||||
$(TEST_LIBC_CONV_DEPS) \
|
||||
o/$(MODE)/test/libc/conv/%.o \
|
||||
o/$(MODE)/test/libc/conv/conv.pkg \
|
||||
$(LIBC_TESTMAIN) \
|
||||
$(CRT) \
|
||||
$(APE)
|
||||
@$(APELINK)
|
||||
|
||||
$(TEST_LIBC_CONV_OBJS): test/libc/conv/test.mk
|
||||
|
||||
$(TEST_LIBC_CONV_OBJS): \
|
||||
DEFAULT_CCFLAGS += \
|
||||
-fno-builtin
|
||||
|
||||
.PHONY: o/$(MODE)/test/libc/conv
|
||||
o/$(MODE)/test/libc/conv: \
|
||||
$(TEST_LIBC_CONV_BINS) \
|
||||
$(TEST_LIBC_CONV_CHECKS)
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/conv/conv.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
|
@ -17,8 +17,8 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/conv/conv.h"
|
||||
#include "libc/conv/itoa.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
|
@ -17,7 +17,7 @@
|
|||
│ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA │
|
||||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/conv/itoa.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
TEST(itoa64radix16, test) {
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/conv/conv.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
|
@ -27,9 +27,9 @@
|
|||
#include "libc/bits/progn.internal.h"
|
||||
#include "libc/bits/pushpop.h"
|
||||
#include "libc/bits/safemacros.internal.h"
|
||||
#include "libc/conv/itoa.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/fmt/fmt.h"
|
||||
#include "libc/fmt/itoa.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/conv/conv.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
TEST(strtoimax, testZero) {
|
|
@ -18,14 +18,22 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/conv/conv.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/limits.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
TEST(strtoumax, testZero) { EXPECT_EQ(UINTMAX_MIN, strtoumax("0", NULL, 0)); }
|
||||
TEST(strtoumax, testDecimal) { EXPECT_EQ(123, strtoumax("123", NULL, 0)); }
|
||||
TEST(strtoumax, testHex) { EXPECT_EQ(255, strtoumax("0xff", NULL, 0)); }
|
||||
TEST(strtoumax, testOctal) { EXPECT_EQ(123, strtoumax("0173", NULL, 0)); }
|
||||
TEST(strtoumax, testZero) {
|
||||
EXPECT_EQ(UINTMAX_MIN, strtoumax("0", NULL, 0));
|
||||
}
|
||||
TEST(strtoumax, testDecimal) {
|
||||
EXPECT_EQ(123, strtoumax("123", NULL, 0));
|
||||
}
|
||||
TEST(strtoumax, testHex) {
|
||||
EXPECT_EQ(255, strtoumax("0xff", NULL, 0));
|
||||
}
|
||||
TEST(strtoumax, testOctal) {
|
||||
EXPECT_EQ(123, strtoumax("0173", NULL, 0));
|
||||
}
|
||||
|
||||
TEST(strtoumax, testMaximum) {
|
||||
EXPECT_EQ(UINTMAX_MAX,
|
|
@ -21,7 +21,6 @@ TEST_LIBC_FMT_CHECKS = \
|
|||
TEST_LIBC_FMT_DIRECTDEPS = \
|
||||
LIBC_ALG \
|
||||
LIBC_CALLS_HEFTY \
|
||||
LIBC_CONV \
|
||||
LIBC_FMT \
|
||||
LIBC_MEM \
|
||||
LIBC_NEXGEN32E \
|
||||
|
@ -55,6 +54,10 @@ o/$(MODE)/test/libc/fmt/%.com.dbg: \
|
|||
|
||||
$(TEST_LIBC_FMT_OBJS): test/libc/fmt/test.mk
|
||||
|
||||
$(TEST_LIBC_FMT_OBJS): \
|
||||
DEFAULT_CCFLAGS += \
|
||||
-fno-builtin
|
||||
|
||||
.PHONY: o/$(MODE)/test/libc/fmt
|
||||
o/$(MODE)/test/libc/fmt: \
|
||||
$(TEST_LIBC_FMT_BINS) \
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/struct/timeval.h"
|
||||
#include "libc/conv/conv.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/nt/struct/filetime.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/time.h"
|
|
@ -6,7 +6,6 @@ o/$(MODE)/test/libc: \
|
|||
o/$(MODE)/test/libc/alg \
|
||||
o/$(MODE)/test/libc/bits \
|
||||
o/$(MODE)/test/libc/calls \
|
||||
o/$(MODE)/test/libc/conv \
|
||||
o/$(MODE)/test/libc/crypto \
|
||||
o/$(MODE)/test/libc/dns \
|
||||
o/$(MODE)/test/libc/fmt \
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
│ 02110-1301 USA │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/struct/timespec.h"
|
||||
#include "libc/conv/conv.h"
|
||||
#include "libc/fmt/conv.h"
|
||||
#include "libc/macros.h"
|
||||
#include "libc/runtime/gc.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue