1
Fork 0

Remove early play tests

This commit is contained in:
Jan-Erik Rediger 2024-06-02 01:08:53 +02:00
parent a1dd0b21f4
commit 5c2cbc37e7
3 changed files with 2 additions and 62 deletions

View file

@ -15,26 +15,18 @@ classpathify = $(subst $(eval ) ,:,$1)
HAREEXTRAPATH = $(HAREPATH)
HAREEXTRAPATH += $(wildcard vendor/*)
all: proctest httpd threads
proctest: $(wildcard cmd/proctest/*.ha) $(SOURCES)
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
all: httpd
httpd: $(wildcard cmd/httpd/*.ha) $(SOURCES)
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
threads: $(wildcard cmd/threads/*.ha) $(SOURCES)
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
check:
HAREPATH=$(HAREPATH):$(HAREEXTRAPATH) \
$(HARE) test $(HAREFLAGS)
clean:
rm -f proctest httpd threads
rm -f httpd
install: httpd
install -Dm755 web $(DESTDIR)$(BINDIR)/httpd

View file

@ -1,35 +0,0 @@
use fmt;
use io;
use os::exec;
use os;
use strings;
export fn main() void = {
let cmd = exec::cmd("./run.sh")!;
let stdout_pipe = exec::pipe();
exec::addfile(&cmd, os::stdout_file, stdout_pipe.1);
let stderr_pipe = exec::pipe();
exec::addfile(&cmd, os::stderr_file, stderr_pipe.1);
let proc = exec::start(&cmd)!;
io::close(stdout_pipe.1)!;
io::close(stderr_pipe.1)!;
let stdout_data = io::drain(stdout_pipe.0)!;
io::close(stdout_pipe.0)!;
let stderr_data = io::drain(stderr_pipe.0)!;
io::close(stderr_pipe.0)!;
let status = exec::wait(&proc)!;
let s = exec::exit(&status) as int;
fmt::printfln("status: {}", s)!;
let out = strings::fromutf8(stdout_data) as str;
fmt::printfln("stdout:\n{}", out)!;
let out = strings::fromutf8(stderr_data) as str;
fmt::printfln("stderr:\n{}", out)!;
};

View file

@ -1,17 +0,0 @@
use types::c;
use fmt;
use thread;
fn thread_start(data: nullable *opaque) void = {
let arg = data: *u32;
fmt::printfln("hello from another thread. you sent: {}", *arg)!;
};
export fn main() void = {
fmt::println("starting a thread")!;
let tid = thread::spawn(&thread_start, &42)!;
fmt::println("joining")!;
thread::join(tid)!;
fmt::println("joined. good bye.")!;
};