mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 00:02:28 +00:00
Stop using .com extension in monorepo
The WIN32 CreateProcess() function does not require an .exe or .com suffix in order to spawn an executable. Now that we have Cosmo bash we're no longer so dependent on the cmd.exe prompt.
This commit is contained in:
parent
c8383f25b4
commit
a6baba1b07
239 changed files with 2092 additions and 2244 deletions
|
@ -9,24 +9,24 @@ TEST_TOOL_ARGS_FILES := $(wildcard test/tool/args/*)
|
|||
TEST_TOOL_ARGS_SRCS = $(filter %.c,$(TEST_TOOL_ARGS_FILES))
|
||||
TEST_TOOL_ARGS_SRCS_TEST = $(filter %_test.c,$(TEST_TOOL_ARGS_SRCS))
|
||||
TEST_TOOL_ARGS_HDRS = $(filter %.h,$(TEST_TOOL_ARGS_FILES))
|
||||
TEST_TOOL_ARGS_COMS = $(TEST_TOOL_ARGS_OBJS:%.o=%.com)
|
||||
TEST_TOOL_ARGS_COMS = $(TEST_TOOL_ARGS_OBJS:%.o=%)
|
||||
|
||||
TEST_TOOL_ARGS_OBJS = \
|
||||
$(TEST_TOOL_ARGS_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
||||
TEST_TOOL_ARGS_COMS = \
|
||||
$(TEST_TOOL_ARGS_SRCS:%.c=o/$(MODE)/%.com)
|
||||
$(TEST_TOOL_ARGS_SRCS:%.c=o/$(MODE)/%)
|
||||
|
||||
TEST_TOOL_ARGS_BINS = \
|
||||
$(TEST_TOOL_ARGS_COMS) \
|
||||
$(TEST_TOOL_ARGS_COMS:%=%.dbg)
|
||||
|
||||
TEST_TOOL_ARGS_TESTS = \
|
||||
$(TEST_TOOL_ARGS_SRCS_TEST:%.c=o/$(MODE)/%.com.ok)
|
||||
$(TEST_TOOL_ARGS_SRCS_TEST:%.c=o/$(MODE)/%.ok)
|
||||
|
||||
TEST_TOOL_ARGS_CHECKS = \
|
||||
$(TEST_TOOL_ARGS_HDRS:%=o/$(MODE)/%.ok) \
|
||||
$(TEST_TOOL_ARGS_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
|
||||
$(TEST_TOOL_ARGS_SRCS_TEST:%.c=o/$(MODE)/%.runs)
|
||||
|
||||
TEST_TOOL_ARGS_DIRECTDEPS = \
|
||||
LIBC_CALLS \
|
||||
|
@ -56,7 +56,7 @@ $(TEST_TOOL_ARGS_A).pkg: \
|
|||
$(TEST_TOOL_ARGS_OBJS) \
|
||||
$(foreach x,$(TEST_TOOL_ARGS_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/test/tool/args/%.com.dbg: \
|
||||
o/$(MODE)/test/tool/args/%.dbg: \
|
||||
$(TEST_TOOL_ARGS_DEPS) \
|
||||
$(TEST_TOOL_ARGS_A) \
|
||||
o/$(MODE)/test/tool/args/%.o \
|
||||
|
|
|
@ -9,24 +9,24 @@ TEST_TOOL_BUILD_LIB_FILES := $(wildcard test/tool/build/lib/*)
|
|||
TEST_TOOL_BUILD_LIB_SRCS = $(filter %.c,$(TEST_TOOL_BUILD_LIB_FILES))
|
||||
TEST_TOOL_BUILD_LIB_SRCS_TEST = $(filter %_test.c,$(TEST_TOOL_BUILD_LIB_SRCS))
|
||||
TEST_TOOL_BUILD_LIB_HDRS = $(filter %.h,$(TEST_TOOL_BUILD_LIB_FILES))
|
||||
TEST_TOOL_BUILD_LIB_COMS = $(TEST_TOOL_BUILD_LIB_OBJS:%.o=%.com)
|
||||
TEST_TOOL_BUILD_LIB_COMS = $(TEST_TOOL_BUILD_LIB_OBJS:%.o=%)
|
||||
|
||||
TEST_TOOL_BUILD_LIB_OBJS = \
|
||||
$(TEST_TOOL_BUILD_LIB_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
||||
TEST_TOOL_BUILD_LIB_COMS = \
|
||||
$(TEST_TOOL_BUILD_LIB_SRCS:%.c=o/$(MODE)/%.com)
|
||||
$(TEST_TOOL_BUILD_LIB_SRCS:%.c=o/$(MODE)/%)
|
||||
|
||||
TEST_TOOL_BUILD_LIB_BINS = \
|
||||
$(TEST_TOOL_BUILD_LIB_COMS) \
|
||||
$(TEST_TOOL_BUILD_LIB_COMS:%=%.dbg)
|
||||
|
||||
TEST_TOOL_BUILD_LIB_TESTS = \
|
||||
$(TEST_TOOL_BUILD_LIB_SRCS_TEST:%.c=o/$(MODE)/%.com.ok)
|
||||
$(TEST_TOOL_BUILD_LIB_SRCS_TEST:%.c=o/$(MODE)/%.ok)
|
||||
|
||||
TEST_TOOL_BUILD_LIB_CHECKS = \
|
||||
$(TEST_TOOL_BUILD_LIB_HDRS:%=o/$(MODE)/%.ok) \
|
||||
$(TEST_TOOL_BUILD_LIB_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
|
||||
$(TEST_TOOL_BUILD_LIB_SRCS_TEST:%.c=o/$(MODE)/%.runs)
|
||||
|
||||
TEST_TOOL_BUILD_LIB_DIRECTDEPS = \
|
||||
LIBC_CALLS \
|
||||
|
@ -57,7 +57,7 @@ $(TEST_TOOL_BUILD_LIB_A).pkg: \
|
|||
$(TEST_TOOL_BUILD_LIB_OBJS) \
|
||||
$(foreach x,$(TEST_TOOL_BUILD_LIB_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/test/tool/build/lib/%.com.dbg: \
|
||||
o/$(MODE)/test/tool/build/lib/%.dbg: \
|
||||
$(TEST_TOOL_BUILD_LIB_DEPS) \
|
||||
$(TEST_TOOL_BUILD_LIB_A) \
|
||||
o/$(MODE)/test/tool/build/lib/%.o \
|
||||
|
|
|
@ -5,21 +5,21 @@ t=/tmp/pledge-test
|
|||
if [ $# = 0 ]; then
|
||||
if ! [ $(id -u) = 0 ]; then
|
||||
make -j16 MODE=fastbuild \
|
||||
o/fastbuild/examples/ls.com \
|
||||
o/fastbuild/tool/curl/curl.com \
|
||||
o/fastbuild/examples/life.com \
|
||||
o/fastbuild/examples/hello.com \
|
||||
o/fastbuild/examples/printargs.com \
|
||||
o/fastbuild/tool/build/assimilate.com \
|
||||
o/fastbuild/tool/build/pledge.com || exit
|
||||
o/fastbuild/examples/ls \
|
||||
o/fastbuild/tool/curl/curl \
|
||||
o/fastbuild/examples/life \
|
||||
o/fastbuild/examples/hello \
|
||||
o/fastbuild/examples/printargs \
|
||||
o/fastbuild/tool/build/assimilate \
|
||||
o/fastbuild/tool/build/pledge || exit
|
||||
make -j16 MODE=$m \
|
||||
o/$m/examples/ls.com \
|
||||
o/$m/tool/curl/curl.com \
|
||||
o/$m/examples/life.com \
|
||||
o/$m/examples/hello.com \
|
||||
o/$m/examples/printargs.com \
|
||||
o/$m/tool/build/assimilate.com \
|
||||
o/$m/tool/build/pledge.com || exit
|
||||
o/$m/examples/ls \
|
||||
o/$m/tool/curl/curl \
|
||||
o/$m/examples/life \
|
||||
o/$m/examples/hello \
|
||||
o/$m/examples/printargs \
|
||||
o/$m/tool/build/assimilate \
|
||||
o/$m/tool/build/pledge || exit
|
||||
test/tool/build/pledge_test.sh ape_binfmt_test_suite || exit
|
||||
test/tool/build/pledge_test.sh ape_loader_test_suite || exit
|
||||
test/tool/build/pledge_test.sh ape_assimilated_test_suite || exit
|
||||
|
@ -59,41 +59,41 @@ if [ "$1" = setuid_setup ]; then
|
|||
rm -rf $t || exit
|
||||
mkdir -p $t || exit
|
||||
chmod 01777 $t || exit
|
||||
cp o/$m/tool/build/pledge.com $t || exit
|
||||
chmod 06755 $t/pledge.com || exit
|
||||
cp o/$m/tool/build/pledge $t || exit
|
||||
chmod 06755 $t/pledge || exit
|
||||
|
||||
elif [ "$1" = ape_binfmt_test_suite ]; then
|
||||
|
||||
ape/apeinstall.sh >/dev/null 2>&1
|
||||
|
||||
startit ape binfmt life.com
|
||||
o/fastbuild/tool/build/pledge.com -p 'stdio rpath prot_exec' o/fastbuild/examples/life.com
|
||||
startit ape binfmt life
|
||||
o/fastbuild/tool/build/pledge -p 'stdio rpath prot_exec' o/fastbuild/examples/life
|
||||
[ $? = 42 ]
|
||||
checkem
|
||||
|
||||
startit ape binfmt hello.com
|
||||
[ "$(o/fastbuild/tool/build/pledge.com -p 'stdio rpath prot_exec' o/fastbuild/examples/hello.com)" = "hello world" ]
|
||||
startit ape binfmt hello
|
||||
[ "$(o/fastbuild/tool/build/pledge -p 'stdio rpath prot_exec' o/fastbuild/examples/hello)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
startit ape binfmt curl.com
|
||||
[ "$(o/fastbuild/tool/build/pledge.com -p 'stdio inet dns rpath prot_exec' o/fastbuild/tool/curl/curl.com https://justine.lol/hello.txt)" = "hello world" ]
|
||||
startit ape binfmt curl
|
||||
[ "$(o/fastbuild/tool/build/pledge -p 'stdio inet dns rpath prot_exec' o/fastbuild/tool/curl/curl https://justine.lol/hello.txt)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
elif [ "$1" = ape_loader_test_suite ]; then
|
||||
|
||||
ape/apeuninstall.sh >/dev/null 2>&1
|
||||
|
||||
startit ape loader life.com
|
||||
o/fastbuild/tool/build/pledge.com -p 'stdio rpath prot_exec' o/fastbuild/examples/life.com
|
||||
startit ape loader life
|
||||
o/fastbuild/tool/build/pledge -p 'stdio rpath prot_exec' o/fastbuild/examples/life
|
||||
[ $? = 42 ]
|
||||
checkem
|
||||
|
||||
startit ape loader hello.com
|
||||
[ "$(o/fastbuild/tool/build/pledge.com -p 'stdio rpath prot_exec' o/fastbuild/examples/hello.com)" = "hello world" ]
|
||||
startit ape loader hello
|
||||
[ "$(o/fastbuild/tool/build/pledge -p 'stdio rpath prot_exec' o/fastbuild/examples/hello)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
startit ape loader curl.com
|
||||
[ "$(o/fastbuild/tool/build/pledge.com -p 'stdio inet dns rpath prot_exec' o/fastbuild/tool/curl/curl.com https://justine.lol/hello.txt)" = "hello world" ]
|
||||
startit ape loader curl
|
||||
[ "$(o/fastbuild/tool/build/pledge -p 'stdio inet dns rpath prot_exec' o/fastbuild/tool/curl/curl https://justine.lol/hello.txt)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
ape/apeinstall.sh >/dev/null 2>&1
|
||||
|
@ -102,76 +102,76 @@ elif [ "$1" = ape_assimilated_test_suite ]; then
|
|||
|
||||
mkdir -p $t/assimilated
|
||||
|
||||
startit ape assimilated life.com
|
||||
cp o/fastbuild/examples/life.com $t/assimilated
|
||||
o/fastbuild/tool/build/assimilate.com $t/assimilated/life.com
|
||||
o/$m/tool/build/pledge.com -p 'stdio' $t/assimilated/life.com
|
||||
startit ape assimilated life
|
||||
cp o/fastbuild/examples/life $t/assimilated
|
||||
o/fastbuild/tool/build/assimilate $t/assimilated/life
|
||||
o/$m/tool/build/pledge -p 'stdio' $t/assimilated/life
|
||||
[ $? = 42 ]
|
||||
checkem
|
||||
|
||||
startit ape assimilated hello.com
|
||||
cp o/fastbuild/examples/hello.com $t/assimilated
|
||||
o/fastbuild/tool/build/assimilate.com $t/assimilated/hello.com
|
||||
[ "$(o/$m/tool/build/pledge.com -p 'stdio' $t/assimilated/hello.com)" = "hello world" ]
|
||||
startit ape assimilated hello
|
||||
cp o/fastbuild/examples/hello $t/assimilated
|
||||
o/fastbuild/tool/build/assimilate $t/assimilated/hello
|
||||
[ "$(o/$m/tool/build/pledge -p 'stdio' $t/assimilated/hello)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
startit ape assimilated curl.com
|
||||
cp o/fastbuild/tool/curl/curl.com $t/assimilated
|
||||
o/fastbuild/tool/build/assimilate.com $t/assimilated/curl.com
|
||||
[ "$(o/$m/tool/build/pledge.com -p 'stdio rpath inet dns' $t/assimilated/curl.com https://justine.lol/hello.txt)" = "hello world" ]
|
||||
startit ape assimilated curl
|
||||
cp o/fastbuild/tool/curl/curl $t/assimilated
|
||||
o/fastbuild/tool/build/assimilate $t/assimilated/curl
|
||||
[ "$(o/$m/tool/build/pledge -p 'stdio rpath inet dns' $t/assimilated/curl https://justine.lol/hello.txt)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
elif [ "$1" = ape_native_test_suite ]; then
|
||||
|
||||
startit ape native life.com
|
||||
o/$m/tool/build/pledge.com -p 'stdio' o/$m/examples/life.com
|
||||
startit ape native life
|
||||
o/$m/tool/build/pledge -p 'stdio' o/$m/examples/life
|
||||
[ $? = 42 ]
|
||||
checkem
|
||||
|
||||
startit ape native hello.com
|
||||
[ "$(o/$m/tool/build/pledge.com -p 'stdio' o/$m/examples/hello.com)" = "hello world" ]
|
||||
startit ape native hello
|
||||
[ "$(o/$m/tool/build/pledge -p 'stdio' o/$m/examples/hello)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
startit ape native curl.com
|
||||
[ "$(o/$m/tool/build/pledge.com -p 'stdio rpath inet dns' o/$m/tool/curl/curl.com https://justine.lol/hello.txt)" = "hello world" ]
|
||||
startit ape native curl
|
||||
[ "$(o/$m/tool/build/pledge -p 'stdio rpath inet dns' o/$m/tool/curl/curl https://justine.lol/hello.txt)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
elif [ "$1" = setuid_test_suite ]; then
|
||||
|
||||
startit setuid life.com
|
||||
$t/pledge.com -p 'stdio' o/$m/examples/life.com
|
||||
startit setuid life
|
||||
$t/pledge -p 'stdio' o/$m/examples/life
|
||||
[ $? = 42 ]
|
||||
checkem
|
||||
|
||||
startit setuid hello.com
|
||||
[ "$($t/pledge.com -p 'stdio' o/$m/examples/hello.com)" = "hello world" ]
|
||||
startit setuid hello
|
||||
[ "$($t/pledge -p 'stdio' o/$m/examples/hello)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
startit setuid curl.com
|
||||
[ "$($t/pledge.com -p 'stdio rpath inet dns' o/$m/tool/curl/curl.com https://justine.lol/hello.txt)" = "hello world" ]
|
||||
startit setuid curl
|
||||
[ "$($t/pledge -p 'stdio rpath inet dns' o/$m/tool/curl/curl https://justine.lol/hello.txt)" = "hello world" ]
|
||||
checkem
|
||||
|
||||
startit setuid getuid
|
||||
[ "$($t/pledge.com -p 'stdio rpath proc tty' o/$m/examples/printargs.com 2>&1 | grep getuid | grep -o [[:digit:]]*)" = "$(id -u)" ]
|
||||
[ "$($t/pledge -p 'stdio rpath proc tty' o/$m/examples/printargs 2>&1 | grep getuid | grep -o [[:digit:]]*)" = "$(id -u)" ]
|
||||
checkem
|
||||
|
||||
startit setuid geteuid
|
||||
[ "$($t/pledge.com -p 'stdio rpath proc tty' o/$m/examples/printargs.com 2>&1 | grep geteuid | grep -o [[:digit:]]*)" = "$(id -u)" ]
|
||||
[ "$($t/pledge -p 'stdio rpath proc tty' o/$m/examples/printargs 2>&1 | grep geteuid | grep -o [[:digit:]]*)" = "$(id -u)" ]
|
||||
checkem
|
||||
|
||||
startit setuid no capabilities
|
||||
[ "$($t/pledge.com -p 'stdio rpath proc tty' o/$m/examples/printargs.com 2>&1 | grep CAP_ | wc -l)" = 0 ]
|
||||
[ "$($t/pledge -p 'stdio rpath proc tty' o/$m/examples/printargs 2>&1 | grep CAP_ | wc -l)" = 0 ]
|
||||
checkem
|
||||
|
||||
startit setuid maximum nice
|
||||
$t/pledge.com -np 'stdio rpath proc tty' o/$m/examples/printargs.com 2>&1 | grep SCHED_IDLE >/dev/null
|
||||
$t/pledge -np 'stdio rpath proc tty' o/$m/examples/printargs 2>&1 | grep SCHED_IDLE >/dev/null
|
||||
checkem
|
||||
|
||||
startit setuid chroot
|
||||
mkdir $t/jail &&
|
||||
touch $t/jail/hi &&
|
||||
cp o/$m/examples/ls.com $t/jail &&
|
||||
$t/pledge.com -v / -c $t/jail -p 'stdio rpath' /ls.com / | grep 'DT_REG /hi' >/dev/null
|
||||
cp o/$m/examples/ls $t/jail &&
|
||||
$t/pledge -v / -c $t/jail -p 'stdio rpath' /ls / | grep 'DT_REG /hi' >/dev/null
|
||||
checkem
|
||||
|
||||
fi
|
||||
|
|
|
@ -10,22 +10,22 @@ TEST_TOOL_NET_SRCS = $(filter %.c,$(TEST_TOOL_NET_FILES))
|
|||
TEST_TOOL_NET_SRCS_TEST = $(filter %_test.c,$(TEST_TOOL_NET_SRCS))
|
||||
TEST_TOOL_NET_LUAS_TEST = $(filter %_test.lua,$(TEST_TOOL_NET_FILES))
|
||||
TEST_TOOL_NET_HDRS = $(filter %.h,$(TEST_TOOL_NET_FILES))
|
||||
TEST_TOOL_NET_COMS = $(TEST_TOOL_NET_SRCS:%.c=o/$(MODE)/%.com)
|
||||
TEST_TOOL_NET_COMS = $(TEST_TOOL_NET_SRCS:%.c=o/$(MODE)/%)
|
||||
|
||||
TEST_TOOL_NET_OBJS = \
|
||||
$(TEST_TOOL_NET_SRCS:%.c=o/$(MODE)/%.o) \
|
||||
o/$(MODE)/test/tool/net/redbean-tester.com.zip.o
|
||||
o/$(MODE)/test/tool/net/redbean-tester.zip.o
|
||||
|
||||
TEST_TOOL_NET_BINS = \
|
||||
$(TEST_TOOL_NET_COMS) \
|
||||
$(TEST_TOOL_NET_COMS:%=%.dbg)
|
||||
|
||||
TEST_TOOL_NET_TESTS = \
|
||||
$(TEST_TOOL_NET_SRCS_TEST:%.c=o/$(MODE)/%.com.ok)
|
||||
$(TEST_TOOL_NET_SRCS_TEST:%.c=o/$(MODE)/%.ok)
|
||||
|
||||
TEST_TOOL_NET_CHECKS = \
|
||||
$(TEST_TOOL_NET_HDRS:%=o/$(MODE)/%.ok) \
|
||||
$(TEST_TOOL_NET_SRCS_TEST:%.c=o/$(MODE)/%.com.runs) \
|
||||
$(TEST_TOOL_NET_SRCS_TEST:%.c=o/$(MODE)/%.runs) \
|
||||
$(TEST_TOOL_NET_LUAS_TEST:%.lua=o/$(MODE)/%.lua.runs)
|
||||
|
||||
TEST_TOOL_NET_DIRECTDEPS = \
|
||||
|
@ -60,7 +60,7 @@ $(TEST_TOOL_NET_A).pkg: \
|
|||
$(TEST_TOOL_NET_OBJS) \
|
||||
$(foreach x,$(TEST_TOOL_NET_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/test/tool/net/%.com.dbg: \
|
||||
o/$(MODE)/test/tool/net/%.dbg: \
|
||||
$(TEST_TOOL_NET_DEPS) \
|
||||
$(TEST_TOOL_NET_A) \
|
||||
o/$(MODE)/test/tool/net/%.o \
|
||||
|
@ -70,7 +70,8 @@ o/$(MODE)/test/tool/net/%.com.dbg: \
|
|||
$(APE_NO_MODIFY_SELF)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/test/tool/net/redbean-tester.com.dbg: \
|
||||
.PRECIOUS: o/$(MODE)/test/tool/net/redbean-tester
|
||||
o/$(MODE)/test/tool/net/redbean-tester.dbg: \
|
||||
$(TOOL_NET_DEPS) \
|
||||
o/$(MODE)/tool/net/redbean.o \
|
||||
$(TOOL_NET_REDBEAN_LUA_MODULES) \
|
||||
|
@ -80,20 +81,10 @@ o/$(MODE)/test/tool/net/redbean-tester.com.dbg: \
|
|||
$(APE_NO_MODIFY_SELF)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/test/tool/net/redbean-tester.com: \
|
||||
o/$(MODE)/test/tool/net/redbean-tester.com.dbg \
|
||||
o/$(MODE)/third_party/zip/zip.com \
|
||||
o/$(MODE)/tool/build/symtab.com \
|
||||
$(TOOL_NET_REDBEAN_STANDARD_ASSETS)
|
||||
@$(MAKE_OBJCOPY)
|
||||
@$(MAKE_SYMTAB_CREATE)
|
||||
@$(MAKE_SYMTAB_ZIP)
|
||||
@$(TOOL_NET_REDBEAN_STANDARD_ASSETS_ZIP)
|
||||
|
||||
o/$(MODE)/test/tool/net/redbean_test.com.runs: \
|
||||
o/$(MODE)/test/tool/net/redbean_test.runs: \
|
||||
private .PLEDGE = stdio rpath wpath cpath fattr proc inet
|
||||
|
||||
o/$(MODE)/test/tool/net/sqlite_test.com.runs: \
|
||||
o/$(MODE)/test/tool/net/sqlite_test.runs: \
|
||||
private .PLEDGE = stdio rpath wpath cpath fattr proc flock
|
||||
|
||||
.PHONY: o/$(MODE)/test/tool/net
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
#ifdef __x86_64__
|
||||
|
||||
__static_yoink("zipos");
|
||||
__static_yoink("o/" MODE "/test/tool/net/redbean-tester.com");
|
||||
__static_yoink("o/" MODE "/test/tool/net/redbean-tester");
|
||||
|
||||
int port;
|
||||
|
||||
|
@ -53,9 +53,9 @@ void SetUpOnce(void) {
|
|||
if (IsWindows()) return;
|
||||
testlib_enable_tmp_setup_teardown_once();
|
||||
ASSERT_NE(-1, mkdir("bin", 0755));
|
||||
ASSERT_NE(-1, (fdin = open("/zip/o/" MODE "/test/tool/net/redbean-tester.com",
|
||||
ASSERT_NE(-1, (fdin = open("/zip/o/" MODE "/test/tool/net/redbean-tester",
|
||||
O_RDONLY)));
|
||||
ASSERT_NE(-1, (fdout = creat("bin/redbean-tester.com", 0755)));
|
||||
ASSERT_NE(-1, (fdout = creat("bin/redbean-tester", 0755)));
|
||||
for (;;) {
|
||||
ASSERT_NE(-1, (n = read(fdin, buf, sizeof(buf))));
|
||||
if (!n) break;
|
||||
|
@ -118,8 +118,8 @@ TEST(redbean, testOptions) {
|
|||
close(pipefds[0]);
|
||||
dup2(pipefds[1], 1);
|
||||
sigprocmask(SIG_SETMASK, &savemask, NULL);
|
||||
execv("bin/redbean-tester.com",
|
||||
(char *const[]){"bin/redbean-tester.com", "-vvszXp0", "-l127.0.0.1",
|
||||
execv("bin/redbean-tester",
|
||||
(char *const[]){"bin/redbean-tester", "-vvszXp0", "-l127.0.0.1",
|
||||
__strace > 0 ? "--strace" : 0, 0});
|
||||
_exit(127);
|
||||
}
|
||||
|
@ -157,8 +157,8 @@ TEST(redbean, testPipeline) {
|
|||
close(pipefds[0]);
|
||||
dup2(pipefds[1], 1);
|
||||
sigprocmask(SIG_SETMASK, &savemask, NULL);
|
||||
execv("bin/redbean-tester.com",
|
||||
(char *const[]){"bin/redbean-tester.com", "-vvszXp0", "-l127.0.0.1",
|
||||
execv("bin/redbean-tester",
|
||||
(char *const[]){"bin/redbean-tester", "-vvszXp0", "-l127.0.0.1",
|
||||
__strace > 0 ? "--strace" : 0, 0});
|
||||
_exit(127);
|
||||
}
|
||||
|
@ -205,8 +205,8 @@ TEST(redbean, testContentRange) {
|
|||
close(pipefds[0]);
|
||||
dup2(pipefds[1], 1);
|
||||
sigprocmask(SIG_SETMASK, &savemask, NULL);
|
||||
execv("bin/redbean-tester.com",
|
||||
(char *const[]){"bin/redbean-tester.com", "-vvszXp0", "-l127.0.0.1",
|
||||
execv("bin/redbean-tester",
|
||||
(char *const[]){"bin/redbean-tester", "-vvszXp0", "-l127.0.0.1",
|
||||
__strace > 0 ? "--strace" : 0, 0});
|
||||
_exit(127);
|
||||
}
|
||||
|
|
|
@ -11,11 +11,11 @@ TEST_TOOL_PLINKO_FILES := $(wildcard test/tool/plinko/*)
|
|||
TEST_TOOL_PLINKO_SRCS = $(filter %.c,$(TEST_TOOL_PLINKO_FILES))
|
||||
TEST_TOOL_PLINKO_SRCS_TEST = $(filter %_test.c,$(TEST_TOOL_PLINKO_SRCS))
|
||||
TEST_TOOL_PLINKO_HDRS = $(filter %.h,$(TEST_TOOL_PLINKO_FILES))
|
||||
TEST_TOOL_PLINKO_COMS = $(TEST_TOOL_PLINKO_OBJS:%.o=%.com)
|
||||
TEST_TOOL_PLINKO_COMS = $(TEST_TOOL_PLINKO_OBJS:%.o=%)
|
||||
|
||||
TEST_TOOL_PLINKO_OBJS = \
|
||||
$(TEST_TOOL_PLINKO_SRCS:%.c=o/$(MODE)/%.o) \
|
||||
o/$(MODE)/tool/plinko/plinko.com.zip.o \
|
||||
o/$(MODE)/tool/plinko/plinko.zip.o \
|
||||
o/$(MODE)/tool/plinko/lib/library.lisp.zip.o \
|
||||
o/$(MODE)/tool/plinko/lib/binarytrees.lisp.zip.o \
|
||||
o/$(MODE)/tool/plinko/lib/algebra.lisp.zip.o \
|
||||
|
@ -25,18 +25,18 @@ TEST_TOOL_PLINKO_OBJS = \
|
|||
o/$(MODE)/test/tool/plinko/algebra_test.lisp.zip.o
|
||||
|
||||
TEST_TOOL_PLINKO_COMS = \
|
||||
$(TEST_TOOL_PLINKO_SRCS:%.c=o/$(MODE)/%.com)
|
||||
$(TEST_TOOL_PLINKO_SRCS:%.c=o/$(MODE)/%)
|
||||
|
||||
TEST_TOOL_PLINKO_BINS = \
|
||||
$(TEST_TOOL_PLINKO_COMS) \
|
||||
$(TEST_TOOL_PLINKO_COMS:%=%.dbg)
|
||||
|
||||
TEST_TOOL_PLINKO_TESTS = \
|
||||
$(TEST_TOOL_PLINKO_SRCS_TEST:%.c=o/$(MODE)/%.com.ok)
|
||||
$(TEST_TOOL_PLINKO_SRCS_TEST:%.c=o/$(MODE)/%.ok)
|
||||
|
||||
TEST_TOOL_PLINKO_CHECKS = \
|
||||
$(TEST_TOOL_PLINKO_HDRS:%=o/$(MODE)/%.ok) \
|
||||
$(TEST_TOOL_PLINKO_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
|
||||
$(TEST_TOOL_PLINKO_SRCS_TEST:%.c=o/$(MODE)/%.runs)
|
||||
|
||||
TEST_TOOL_PLINKO_DIRECTDEPS = \
|
||||
LIBC_CALLS \
|
||||
|
@ -67,7 +67,7 @@ $(TEST_TOOL_PLINKO_A).pkg: \
|
|||
$(TEST_TOOL_PLINKO_OBJS) \
|
||||
$(foreach x,$(TEST_TOOL_PLINKO_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/test/tool/plinko/%.com.dbg: \
|
||||
o/$(MODE)/test/tool/plinko/%.dbg: \
|
||||
$(TEST_TOOL_PLINKO_DEPS) \
|
||||
$(TEST_TOOL_PLINKO_A) \
|
||||
o/$(MODE)/test/tool/plinko/%.o \
|
||||
|
@ -77,7 +77,7 @@ o/$(MODE)/test/tool/plinko/%.com.dbg: \
|
|||
$(APE_NO_MODIFY_SELF)
|
||||
@$(APELINK)
|
||||
|
||||
o/$(MODE)/test/tool/plinko/plinko_test.com.runs: private \
|
||||
o/$(MODE)/test/tool/plinko/plinko_test.runs: private \
|
||||
QUOTA = -M100g
|
||||
|
||||
o/$(MODE)/test/tool/plinko/algebra_test.lisp.zip.o: private ZIPOBJ_FLAGS += -B
|
||||
|
|
|
@ -30,7 +30,7 @@
|
|||
#include "libc/testlib/testlib.h"
|
||||
|
||||
__static_yoink("zipos");
|
||||
__static_yoink("plinko.com");
|
||||
__static_yoink("plinko");
|
||||
__static_yoink("library.lisp");
|
||||
__static_yoink("library_test.lisp");
|
||||
__static_yoink("binarytrees.lisp");
|
||||
|
@ -54,8 +54,8 @@ void SetUpOnce(void) {
|
|||
int fdin, fdout;
|
||||
testlib_enable_tmp_setup_teardown_once();
|
||||
ASSERT_NE(-1, mkdir("bin", 0755));
|
||||
ASSERT_NE(-1, (fdin = open("/zip/plinko.com", O_RDONLY)));
|
||||
ASSERT_NE(-1, (fdout = creat("bin/plinko.com", 0755)));
|
||||
ASSERT_NE(-1, (fdin = open("/zip/plinko", O_RDONLY)));
|
||||
ASSERT_NE(-1, (fdout = creat("bin/plinko", 0755)));
|
||||
ASSERT_NE(-1, copyfd(fdin, fdout, -1));
|
||||
EXPECT_EQ(0, close(fdout));
|
||||
EXPECT_EQ(0, close(fdin));
|
||||
|
@ -89,8 +89,7 @@ TEST(plinko, worksOrPrintsNiceError) {
|
|||
sigaction(SIGQUIT, &savequit, 0);
|
||||
sigaction(SIGPIPE, &savepipe, 0);
|
||||
sigprocmask(SIG_SETMASK, &savemask, 0);
|
||||
execve("bin/plinko.com", (char *const[]){"bin/plinko.com", 0},
|
||||
(char *const[]){0});
|
||||
execve("bin/plinko", (char *const[]){"bin/plinko", 0}, (char *const[]){0});
|
||||
_exit(127);
|
||||
}
|
||||
close(pfds[0][0]);
|
||||
|
|
|
@ -10,17 +10,17 @@ TEST_TOOL_VIZ_LIB_OBJS = \
|
|||
$(TEST_TOOL_VIZ_LIB_SRCS:%.c=o/$(MODE)/%.o)
|
||||
|
||||
TEST_TOOL_VIZ_LIB_COMS = \
|
||||
$(TEST_TOOL_VIZ_LIB_SRCS:%.c=o/$(MODE)/%.com)
|
||||
$(TEST_TOOL_VIZ_LIB_SRCS:%.c=o/$(MODE)/%)
|
||||
|
||||
TEST_TOOL_VIZ_LIB_BINS = \
|
||||
$(TEST_TOOL_VIZ_LIB_COMS) \
|
||||
$(TEST_TOOL_VIZ_LIB_COMS:%=%.dbg)
|
||||
|
||||
TEST_TOOL_VIZ_LIB_TESTS = \
|
||||
$(TEST_TOOL_VIZ_LIB_SRCS_TEST:%.c=o/$(MODE)/%.com.ok)
|
||||
$(TEST_TOOL_VIZ_LIB_SRCS_TEST:%.c=o/$(MODE)/%.ok)
|
||||
|
||||
TEST_TOOL_VIZ_LIB_CHECKS = \
|
||||
$(TEST_TOOL_VIZ_LIB_SRCS_TEST:%.c=o/$(MODE)/%.com.runs)
|
||||
$(TEST_TOOL_VIZ_LIB_SRCS_TEST:%.c=o/$(MODE)/%.runs)
|
||||
|
||||
TEST_TOOL_VIZ_LIB_DIRECTDEPS = \
|
||||
DSP_MPEG \
|
||||
|
@ -45,7 +45,7 @@ o/$(MODE)/test/tool/viz/lib/vizlib.pkg: \
|
|||
$(TEST_TOOL_VIZ_LIB_OBJS) \
|
||||
$(foreach x,$(TEST_TOOL_VIZ_LIB_DIRECTDEPS),$($(x)_A).pkg)
|
||||
|
||||
o/$(MODE)/test/tool/viz/lib/%.com.dbg: \
|
||||
o/$(MODE)/test/tool/viz/lib/%.dbg: \
|
||||
$(TEST_TOOL_VIZ_LIB_DEPS) \
|
||||
o/$(MODE)/test/tool/viz/lib/%.o \
|
||||
o/$(MODE)/test/tool/viz/lib/vizlib.pkg \
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue