mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-05-28 08:12:28 +00:00
parent
95f54eeb40
commit
c1d99676c4
1421 changed files with 5556 additions and 2198 deletions
|
@ -23,14 +23,12 @@
|
|||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/intrin/spinlock.h"
|
||||
#include "libc/intrin/wait0.internal.h"
|
||||
#include "libc/macros.internal.h"
|
||||
#include "libc/math.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/runtime/stack.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/clone.h"
|
||||
#include "libc/sysv/consts/map.h"
|
||||
#include "libc/sysv/consts/prot.h"
|
||||
|
@ -53,11 +51,6 @@ union Dub {
|
|||
double x;
|
||||
};
|
||||
|
||||
void SetUpOnce(void) {
|
||||
__enable_threads();
|
||||
ASSERT_SYS(0, 0, pledge("stdio", 0));
|
||||
}
|
||||
|
||||
int Worker(void *p, int tid) {
|
||||
int i;
|
||||
char str[64];
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/stdio/lock.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/hyperion.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
|
|
@ -25,7 +25,6 @@
|
|||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/sysv/consts/sig.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/time/time.h"
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/stdio/iconv.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
TEST(iconv, test) {
|
||||
|
|
|
@ -19,7 +19,6 @@
|
|||
#include "libc/calls/calls.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/runtime/gc.internal.h"
|
||||
#include "libc/runtime/internal.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
#include "libc/thread/spawn.h"
|
||||
|
@ -40,11 +39,6 @@ int Worker(void *arg, int tid) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
void SetUpOnce(void) {
|
||||
__enable_threads();
|
||||
ASSERT_SYS(0, 0, pledge("stdio", 0));
|
||||
}
|
||||
|
||||
TEST(memory, test) {
|
||||
int i, n = 32;
|
||||
struct spawn *t = gc(malloc(sizeof(struct spawn) * n));
|
||||
|
|
|
@ -90,13 +90,13 @@ const char kTinyLinuxExit[128] = {
|
|||
0x6a, 0x2a, 0x5f, 0x6a, 0x3c, 0x58, 0x0f, 0x05, // j*_j<X☼♣
|
||||
};
|
||||
|
||||
/* BENCH(spawn, bench) { */
|
||||
/* int fd; */
|
||||
/* if (IsLinux()) { */
|
||||
/* fd = open("/tmp/tiny64", O_CREAT | O_TRUNC | O_WRONLY, 0755); */
|
||||
/* write(fd, kTinyLinuxExit, 128); */
|
||||
/* close(fd); */
|
||||
/* EZBENCH2("spawn", donothing, BenchmarkProcessLifecycle()); */
|
||||
/* unlink("/tmp/tiny64"); */
|
||||
/* } */
|
||||
/* } */
|
||||
BENCH(spawn, bench) {
|
||||
int fd;
|
||||
if (IsLinux()) {
|
||||
fd = open("/tmp/tiny64", O_CREAT | O_TRUNC | O_WRONLY, 0755);
|
||||
write(fd, kTinyLinuxExit, 128);
|
||||
close(fd);
|
||||
EZBENCH2("spawn", donothing, BenchmarkProcessLifecycle());
|
||||
unlink("/tmp/tiny64");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,15 +16,25 @@
|
|||
│ TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR │
|
||||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/calls/calls.h"
|
||||
#include "libc/errno.h"
|
||||
#include "libc/runtime/runtime.h"
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/stdio/temp.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
char testlib_enable_tmp_setup_teardown;
|
||||
|
||||
TEST(tmpfile, test) {
|
||||
FILE *f = tmpfile();
|
||||
FILE *f;
|
||||
mkdir("doge", 0755);
|
||||
setenv("TMPDIR", "doge", true);
|
||||
ASSERT_NE(NULL, (f = tmpfile()));
|
||||
EXPECT_NE(-1, fputc('t', f));
|
||||
EXPECT_NE(-1, fflush(f));
|
||||
rewind(f);
|
||||
EXPECT_EQ('t', fgetc(f));
|
||||
EXPECT_NE(-1, fclose(f));
|
||||
EXPECT_EQ(-1, rmdir("doge"));
|
||||
EXPECT_EQ(ENOTEMPTY, errno);
|
||||
}
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
│ PERFORMANCE OF THIS SOFTWARE. │
|
||||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/stdio/stdio.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/hyperion.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
|
|
|
@ -18,9 +18,7 @@
|
|||
╚─────────────────────────────────────────────────────────────────────────────*/
|
||||
#include "libc/bits/bits.h"
|
||||
#include "libc/intrin/kprintf.h"
|
||||
#include "libc/mem/mem.h"
|
||||
#include "libc/stdio/append.internal.h"
|
||||
#include "libc/str/str.h"
|
||||
#include "libc/testlib/ezbench.h"
|
||||
#include "libc/testlib/testlib.h"
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue