Remove early play tests
This commit is contained in:
parent
a1dd0b21f4
commit
5c2cbc37e7
12
Makefile
12
Makefile
|
@ -15,26 +15,18 @@ classpathify = $(subst $(eval ) ,:,$1)
|
||||||
HAREEXTRAPATH = $(HAREPATH)
|
HAREEXTRAPATH = $(HAREPATH)
|
||||||
HAREEXTRAPATH += $(wildcard vendor/*)
|
HAREEXTRAPATH += $(wildcard vendor/*)
|
||||||
|
|
||||||
all: proctest httpd threads
|
all: httpd
|
||||||
|
|
||||||
proctest: $(wildcard cmd/proctest/*.ha) $(SOURCES)
|
|
||||||
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
|
|
||||||
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
|
|
||||||
|
|
||||||
httpd: $(wildcard cmd/httpd/*.ha) $(SOURCES)
|
httpd: $(wildcard cmd/httpd/*.ha) $(SOURCES)
|
||||||
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
|
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
|
||||||
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
|
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
|
||||||
|
|
||||||
threads: $(wildcard cmd/threads/*.ha) $(SOURCES)
|
|
||||||
HAREPATH=$(call classpathify,$(HAREEXTRAPATH)) \
|
|
||||||
$(HARE) build $(HAREFLAGS) -o $@ cmd/$@/
|
|
||||||
|
|
||||||
check:
|
check:
|
||||||
HAREPATH=$(HAREPATH):$(HAREEXTRAPATH) \
|
HAREPATH=$(HAREPATH):$(HAREEXTRAPATH) \
|
||||||
$(HARE) test $(HAREFLAGS)
|
$(HARE) test $(HAREFLAGS)
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
rm -f proctest httpd threads
|
rm -f httpd
|
||||||
|
|
||||||
install: httpd
|
install: httpd
|
||||||
install -Dm755 web $(DESTDIR)$(BINDIR)/httpd
|
install -Dm755 web $(DESTDIR)$(BINDIR)/httpd
|
||||||
|
|
|
@ -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)!;
|
|
||||||
};
|
|
|
@ -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.")!;
|
|
||||||
};
|
|
Loading…
Reference in a new issue