code
stringlengths
1
2.01M
repo_name
stringlengths
3
62
path
stringlengths
1
267
language
stringclasses
231 values
license
stringclasses
13 values
size
int64
1
2.01M
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (close-bad-fd) begin (close-bad-fd) end close-bad-fd: exit(0) EOF (close-bad-fd) begin close-bad-fd: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/close-bad-fd.ck.svn-base
Perl
oos
216
# -*- perl -*- use strict; use warnings; use tests::tests; our ($test); my (@output) = read_text_file ("$test.output"); common_checks ("run", @output); fail "missing 'begin' message\n" if !grep ($_ eq '(halt) begin', @output); fail "found 'fail' message--halt didn't really halt\n" if grep ($_ eq '(halt) fail', @output); pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/halt.ck.svn-base
Perl
oos
335
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (multi-child-fd) begin (multi-child-fd) open "sample.txt" (child-close) begin (child-close) end child-close: exit(0) (multi-child-fd) wait(exec()) = 0 (multi-child-fd) verified contents of "sample.txt" (multi-child-fd) end multi-child-fd: exit(0) EOF (multi-child-fd) begin (multi-child-fd) open "sample.txt" (child-close) begin child-close: exit(-1) (multi-child-fd) wait(exec()) = -1 (multi-child-fd) verified contents of "sample.txt" (multi-child-fd) end multi-child-fd: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/multi-child-fd.ck.svn-base
Perl
oos
588
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (write-zero) begin (write-zero) open "sample.txt" (write-zero) end write-zero: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/write-zero.ck.svn-base
Perl
oos
184
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (close-stdin) begin (close-stdin) end close-stdin: exit(0) EOF (close-stdin) begin close-stdin: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/close-stdin.ck.svn-base
Perl
oos
211
/* -*- c -*- */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { const char *child_cmd = "child-rox " CHILD_CNT; int handle; pid_t child; char buffer[16]; /* Open child-rox, read from it, write back same data. */ CHECK ((handle = open ("child-rox")) > 1, "open \"child-rox\""); CHECK (read (handle, buffer, sizeof buffer) == (int) sizeof buffer, "read \"child-rox\""); seek (handle, 0); CHECK (write (handle, buffer, sizeof buffer) == (int) sizeof buffer, "write \"child-rox\""); /* Execute child-rox and wait for it. */ CHECK ((child = exec (child_cmd)) != -1, "exec \"%s\"", child_cmd); quiet = true; CHECK (wait (child) == 12, "wait for child"); quiet = false; /* Write to child-rox again. */ seek (handle, 0); CHECK (write (handle, buffer, sizeof buffer) == (int) sizeof buffer, "write \"child-rox\""); }
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/rox-child.inc.svn-base
C
oos
919
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (write-bad-ptr) begin (write-bad-ptr) open "sample.txt" (write-bad-ptr) end write-bad-ptr: exit(0) EOF (write-bad-ptr) begin (write-bad-ptr) open "sample.txt" write-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/write-bad-ptr.ck.svn-base
Perl
oos
289
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (exit) begin exit: exit(57) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/exit.ck.svn-base
Perl
oos
125
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (args) begin (args) argc = 5 (args) argv[0] = 'args-multiple' (args) argv[1] = 'some' (args) argv[2] = 'arguments' (args) argv[3] = 'for' (args) argv[4] = 'you!' (args) argv[5] = null (args) end args-multiple: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/args-multiple.ck.svn-base
Perl
oos
315
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (args) begin (args) argc = 1 (args) argv[0] = 'args-none' (args) argv[1] = null (args) end args-none: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/args-none.ck.svn-base
Perl
oos
207
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (create-long) begin (create-long) create("x..."): 0 (create-long) end create-long: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/create-long.ck.svn-base
Perl
oos
188
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (exec-bad-ptr) begin (exec-bad-ptr) end exec-bad-ptr: exit(0) EOF (exec-bad-ptr) begin exec-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/exec-bad-ptr.ck.svn-base
Perl
oos
216
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (wait-killed) begin (child-bad) begin child-bad: exit(-1) (wait-killed) wait(exec()) = -1 (wait-killed) end wait-killed: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/wait-killed.ck.svn-base
Perl
oos
226
# -*- makefile -*- tests/%.output: FSDISK = 2 tests/%.output: PUTFILES = $(filter-out os.dsk, $^) tests/userprog_TESTS = $(addprefix tests/userprog/,args-none \ args-single args-multiple args-many args-dbl-space sc-bad-sp \ sc-bad-arg sc-boundary sc-boundary-2 halt exit create-normal \ create-empty create-null create-bad-ptr create-long create-exists \ create-bound open-normal open-missing open-boundary open-empty \ open-null open-bad-ptr open-twice close-normal close-twice close-stdin \ close-stdout close-bad-fd read-normal read-bad-ptr read-boundary \ read-zero read-stdout read-bad-fd write-normal write-bad-ptr \ write-boundary write-zero write-stdin write-bad-fd exec-once exec-arg \ exec-multiple exec-missing exec-bad-ptr wait-simple wait-twice \ wait-killed wait-bad-pid multi-recurse multi-child-fd rox-simple \ rox-child rox-multichild bad-read bad-write bad-read2 bad-write2 \ bad-jump bad-jump2) tests/userprog_PROGS = $(tests/userprog_TESTS) $(addprefix \ tests/userprog/,child-simple child-args child-bad child-close child-rox) tests/userprog/args-none_SRC = tests/userprog/args.c tests/userprog/args-single_SRC = tests/userprog/args.c tests/userprog/args-multiple_SRC = tests/userprog/args.c tests/userprog/args-many_SRC = tests/userprog/args.c tests/userprog/args-dbl-space_SRC = tests/userprog/args.c tests/userprog/sc-bad-sp_SRC = tests/userprog/sc-bad-sp.c tests/main.c tests/userprog/sc-bad-arg_SRC = tests/userprog/sc-bad-arg.c tests/main.c tests/userprog/bad-read_SRC = tests/userprog/bad-read.c tests/main.c tests/userprog/bad-write_SRC = tests/userprog/bad-write.c tests/main.c tests/userprog/bad-jump_SRC = tests/userprog/bad-jump.c tests/main.c tests/userprog/bad-read2_SRC = tests/userprog/bad-read2.c tests/main.c tests/userprog/bad-write2_SRC = tests/userprog/bad-write2.c tests/main.c tests/userprog/bad-jump2_SRC = tests/userprog/bad-jump2.c tests/main.c tests/userprog/sc-boundary_SRC = tests/userprog/sc-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/sc-boundary-2_SRC = tests/userprog/sc-boundary-2.c \ tests/userprog/boundary.c tests/main.c tests/userprog/halt_SRC = tests/userprog/halt.c tests/main.c tests/userprog/exit_SRC = tests/userprog/exit.c tests/main.c tests/userprog/create-normal_SRC = tests/userprog/create-normal.c tests/main.c tests/userprog/create-empty_SRC = tests/userprog/create-empty.c tests/main.c tests/userprog/create-null_SRC = tests/userprog/create-null.c tests/main.c tests/userprog/create-bad-ptr_SRC = tests/userprog/create-bad-ptr.c \ tests/main.c tests/userprog/create-long_SRC = tests/userprog/create-long.c tests/main.c tests/userprog/create-exists_SRC = tests/userprog/create-exists.c tests/main.c tests/userprog/create-bound_SRC = tests/userprog/create-bound.c \ tests/userprog/boundary.c tests/main.c tests/userprog/open-normal_SRC = tests/userprog/open-normal.c tests/main.c tests/userprog/open-missing_SRC = tests/userprog/open-missing.c tests/main.c tests/userprog/open-boundary_SRC = tests/userprog/open-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/open-empty_SRC = tests/userprog/open-empty.c tests/main.c tests/userprog/open-null_SRC = tests/userprog/open-null.c tests/main.c tests/userprog/open-bad-ptr_SRC = tests/userprog/open-bad-ptr.c tests/main.c tests/userprog/open-twice_SRC = tests/userprog/open-twice.c tests/main.c tests/userprog/close-normal_SRC = tests/userprog/close-normal.c tests/main.c tests/userprog/close-twice_SRC = tests/userprog/close-twice.c tests/main.c tests/userprog/close-stdin_SRC = tests/userprog/close-stdin.c tests/main.c tests/userprog/close-stdout_SRC = tests/userprog/close-stdout.c tests/main.c tests/userprog/close-bad-fd_SRC = tests/userprog/close-bad-fd.c tests/main.c tests/userprog/read-normal_SRC = tests/userprog/read-normal.c tests/main.c tests/userprog/read-bad-ptr_SRC = tests/userprog/read-bad-ptr.c tests/main.c tests/userprog/read-boundary_SRC = tests/userprog/read-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/read-zero_SRC = tests/userprog/read-zero.c tests/main.c tests/userprog/read-stdout_SRC = tests/userprog/read-stdout.c tests/main.c tests/userprog/read-bad-fd_SRC = tests/userprog/read-bad-fd.c tests/main.c tests/userprog/write-normal_SRC = tests/userprog/write-normal.c tests/main.c tests/userprog/write-bad-ptr_SRC = tests/userprog/write-bad-ptr.c tests/main.c tests/userprog/write-boundary_SRC = tests/userprog/write-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/write-zero_SRC = tests/userprog/write-zero.c tests/main.c tests/userprog/write-stdin_SRC = tests/userprog/write-stdin.c tests/main.c tests/userprog/write-bad-fd_SRC = tests/userprog/write-bad-fd.c tests/main.c tests/userprog/exec-once_SRC = tests/userprog/exec-once.c tests/main.c tests/userprog/exec-arg_SRC = tests/userprog/exec-arg.c tests/main.c tests/userprog/exec-multiple_SRC = tests/userprog/exec-multiple.c tests/main.c tests/userprog/exec-missing_SRC = tests/userprog/exec-missing.c tests/main.c tests/userprog/exec-bad-ptr_SRC = tests/userprog/exec-bad-ptr.c tests/main.c tests/userprog/wait-simple_SRC = tests/userprog/wait-simple.c tests/main.c tests/userprog/wait-twice_SRC = tests/userprog/wait-twice.c tests/main.c tests/userprog/wait-killed_SRC = tests/userprog/wait-killed.c tests/main.c tests/userprog/wait-bad-pid_SRC = tests/userprog/wait-bad-pid.c tests/main.c tests/userprog/multi-recurse_SRC = tests/userprog/multi-recurse.c tests/userprog/multi-child-fd_SRC = tests/userprog/multi-child-fd.c \ tests/main.c tests/userprog/rox-simple_SRC = tests/userprog/rox-simple.c tests/main.c tests/userprog/rox-child_SRC = tests/userprog/rox-child.c tests/main.c tests/userprog/rox-multichild_SRC = tests/userprog/rox-multichild.c \ tests/main.c tests/userprog/child-simple_SRC = tests/userprog/child-simple.c tests/userprog/child-args_SRC = tests/userprog/args.c tests/userprog/child-bad_SRC = tests/userprog/child-bad.c tests/main.c tests/userprog/child-close_SRC = tests/userprog/child-close.c tests/userprog/child-rox_SRC = tests/userprog/child-rox.c $(foreach prog,$(tests/userprog_PROGS),$(eval $(prog)_SRC += tests/lib.c)) tests/userprog/args-single_ARGS = onearg tests/userprog/args-multiple_ARGS = some arguments for you! tests/userprog/args-many_ARGS = a b c d e f g h i j k l m n o p q r s t u v tests/userprog/args-dbl-space_ARGS = two spaces! tests/userprog/multi-recurse_ARGS = 15 tests/userprog/open-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/open-boundary_PUTFILES += tests/userprog/sample.txt tests/userprog/open-twice_PUTFILES += tests/userprog/sample.txt tests/userprog/close-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/close-twice_PUTFILES += tests/userprog/sample.txt tests/userprog/read-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/read-bad-ptr_PUTFILES += tests/userprog/sample.txt tests/userprog/read-boundary_PUTFILES += tests/userprog/sample.txt tests/userprog/read-zero_PUTFILES += tests/userprog/sample.txt tests/userprog/write-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/write-bad-ptr_PUTFILES += tests/userprog/sample.txt tests/userprog/write-boundary_PUTFILES += tests/userprog/sample.txt tests/userprog/write-zero_PUTFILES += tests/userprog/sample.txt tests/userprog/multi-child-fd_PUTFILES += tests/userprog/sample.txt tests/userprog/exec-once_PUTFILES += tests/userprog/child-simple tests/userprog/exec-multiple_PUTFILES += tests/userprog/child-simple tests/userprog/wait-simple_PUTFILES += tests/userprog/child-simple tests/userprog/wait-twice_PUTFILES += tests/userprog/child-simple tests/userprog/exec-arg_PUTFILES += tests/userprog/child-args tests/userprog/multi-child-fd_PUTFILES += tests/userprog/child-close tests/userprog/wait-killed_PUTFILES += tests/userprog/child-bad tests/userprog/rox-child_PUTFILES += tests/userprog/child-rox tests/userprog/rox-multichild_PUTFILES += tests/userprog/child-rox
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/Make.tests.svn-base
Makefile
oos
7,935
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (create-null) begin create-null: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/create-null.ck.svn-base
Perl
oos
139
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (args) begin (args) argc = 23 (args) argv[0] = 'args-many' (args) argv[1] = 'a' (args) argv[2] = 'b' (args) argv[3] = 'c' (args) argv[4] = 'd' (args) argv[5] = 'e' (args) argv[6] = 'f' (args) argv[7] = 'g' (args) argv[8] = 'h' (args) argv[9] = 'i' (args) argv[10] = 'j' (args) argv[11] = 'k' (args) argv[12] = 'l' (args) argv[13] = 'm' (args) argv[14] = 'n' (args) argv[15] = 'o' (args) argv[16] = 'p' (args) argv[17] = 'q' (args) argv[18] = 'r' (args) argv[19] = 's' (args) argv[20] = 't' (args) argv[21] = 'u' (args) argv[22] = 'v' (args) argv[23] = null (args) end args-many: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/args-many.ck.svn-base
Perl
oos
684
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (create-normal) begin (create-normal) create quux.dat (create-normal) end create-normal: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/create-normal.ck.svn-base
Perl
oos
194
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (open-null) begin (open-null) end open-null: exit(0) EOF (open-null) begin open-null: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/open-null.ck.svn-base
Perl
oos
201
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (args) begin (args) argc = 2 (args) argv[0] = 'args-single' (args) argv[1] = 'onearg' (args) argv[2] = null (args) end args-single: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/args-single.ck.svn-base
Perl
oos
237
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-read) begin bad-read: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/bad-read.ck.svn-base
Perl
oos
158
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (sc-bad-arg) begin sc-bad-arg: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/sc-bad-arg.ck.svn-base
Perl
oos
137
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF', <<'EOF', <<'EOF']); (exec-missing) begin load: no-such-file: open failed (exec-missing) exec("no-such-file"): -1 (exec-missing) end exec-missing: exit(0) EOF (exec-missing) begin (exec-missing) exec("no-such-file"): -1 (exec-missing) end exec-missing: exit(0) EOF (exec-missing) begin load: no-such-file: open failed no-such-file: exit(-1) (exec-missing) exec("no-such-file"): -1 (exec-missing) end exec-missing: exit(0) EOF (exec-missing) begin load: no-such-file: open failed (exec-missing) exec("no-such-file"): -1 no-such-file: exit(-1) (exec-missing) end exec-missing: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/exec-missing.ck.svn-base
Perl
oos
686
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (exec-arg) begin (args) begin (args) argc = 2 (args) argv[0] = 'child-args' (args) argv[1] = 'childarg' (args) argv[2] = null (args) end child-args: exit(0) (exec-arg) end exec-arg: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/exec-arg.ck.svn-base
Perl
oos
287
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (write-normal) begin (write-normal) create "test.txt" (write-normal) open "test.txt" (write-normal) end write-normal: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/write-normal.ck.svn-base
Perl
oos
223
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-jump2) begin bad-jump2: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/bad-jump2.ck.svn-base
Perl
oos
160
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (close-twice) begin (close-twice) open "sample.txt" (close-twice) close "sample.txt" (close-twice) close "sample.txt" again (close-twice) end close-twice: exit(0) EOF (close-twice) begin (close-twice) open "sample.txt" (close-twice) close "sample.txt" (close-twice) close "sample.txt" again close-twice: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/close-twice.ck.svn-base
Perl
oos
419
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (create-empty) begin (create-empty) create(""): 0 (create-empty) end create-empty: exit(0) EOF (create-empty) begin create-empty: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/create-empty.ck.svn-base
Perl
oos
245
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (read-zero) begin (read-zero) open "sample.txt" (read-zero) end read-zero: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/read-zero.ck.svn-base
Perl
oos
180
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (read-bad-fd) begin (read-bad-fd) end read-bad-fd: exit(0) EOF (read-bad-fd) begin read-bad-fd: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/read-bad-fd.ck.svn-base
Perl
oos
211
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (close-normal) begin (close-normal) open "sample.txt" (close-normal) close "sample.txt" (close-normal) end close-normal: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/close-normal.ck.svn-base
Perl
oos
226
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (rox-child) begin (rox-child) open "child-rox" (rox-child) read "child-rox" (rox-child) write "child-rox" (rox-child) exec "child-rox 1" (child-rox) begin (child-rox) try to write "child-rox" (child-rox) try to write "child-rox" (child-rox) end child-rox: exit(12) (rox-child) write "child-rox" (rox-child) end rox-child: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/rox-child.ck.svn-base
Perl
oos
427
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (sc-boundary-2) begin sc-boundary-2: exit(67) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/sc-boundary-2.ck.svn-base
Perl
oos
143
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (open-twice) begin (open-twice) open "sample.txt" once (open-twice) open "sample.txt" again (open-twice) end open-twice: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/open-twice.ck.svn-base
Perl
oos
226
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (close-stdout) begin (close-stdout) end close-stdout: exit(0) EOF (close-stdout) begin close-stdout: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/close-stdout.ck.svn-base
Perl
oos
216
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (open-missing) begin (open-missing) end open-missing: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/open-missing.ck.svn-base
Perl
oos
159
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (wait-twice) begin (child-simple) run child-simple: exit(81) (wait-twice) wait(exec()) = 81 (wait-twice) wait(exec()) = -1 (wait-twice) end wait-twice: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/wait-twice.ck.svn-base
Perl
oos
257
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (wait-bad-pid) begin (wait-bad-pid) end wait-bad-pid: exit(0) EOF (wait-bad-pid) begin wait-bad-pid: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/wait-bad-pid.ck.svn-base
Perl
oos
216
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (write-boundary) begin (write-boundary) open "sample.txt" (write-boundary) end write-boundary: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/write-boundary.ck.svn-base
Perl
oos
200
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (open-empty) begin (open-empty) end open-empty: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/open-empty.ck.svn-base
Perl
oos
153
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (create-bad-ptr) begin create-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/create-bad-ptr.ck.svn-base
Perl
oos
145
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (exec-multiple) begin (child-simple) run child-simple: exit(81) (child-simple) run child-simple: exit(81) (child-simple) run child-simple: exit(81) (child-simple) run child-simple: exit(81) (exec-multiple) end exec-multiple: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/exec-multiple.ck.svn-base
Perl
oos
330
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (wait-simple) begin (child-simple) run child-simple: exit(81) (wait-simple) wait(exec()) = 81 (wait-simple) end wait-simple: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/wait-simple.ck.svn-base
Perl
oos
230
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-write2) begin bad-write2: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/bad-write2.ck.svn-base
Perl
oos
162
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-write) begin bad-write: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/bad-write.ck.svn-base
Perl
oos
160
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (exec-once) begin (child-simple) run child-simple: exit(81) (exec-once) end exec-once: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/exec-once.ck.svn-base
Perl
oos
192
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (rox-multichild) begin (rox-multichild) open "child-rox" (rox-multichild) read "child-rox" (rox-multichild) write "child-rox" (rox-multichild) exec "child-rox 5" (child-rox) begin (child-rox) try to write "child-rox" (child-rox) exec "child-rox 4" (child-rox) begin (child-rox) try to write "child-rox" (child-rox) exec "child-rox 3" (child-rox) begin (child-rox) try to write "child-rox" (child-rox) exec "child-rox 2" (child-rox) begin (child-rox) try to write "child-rox" (child-rox) exec "child-rox 1" (child-rox) begin (child-rox) try to write "child-rox" (child-rox) try to write "child-rox" (child-rox) end child-rox: exit(12) (child-rox) try to write "child-rox" (child-rox) end child-rox: exit(12) (child-rox) try to write "child-rox" (child-rox) end child-rox: exit(12) (child-rox) try to write "child-rox" (child-rox) end child-rox: exit(12) (child-rox) try to write "child-rox" (child-rox) end child-rox: exit(12) (rox-multichild) write "child-rox" (rox-multichild) end rox-multichild: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/rox-multichild.ck.svn-base
Perl
oos
1,103
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (multi-recurse) begin 15 (multi-recurse) exec("multi-recurse 14") (multi-recurse) begin 14 (multi-recurse) exec("multi-recurse 13") (multi-recurse) begin 13 (multi-recurse) exec("multi-recurse 12") (multi-recurse) begin 12 (multi-recurse) exec("multi-recurse 11") (multi-recurse) begin 11 (multi-recurse) exec("multi-recurse 10") (multi-recurse) begin 10 (multi-recurse) exec("multi-recurse 9") (multi-recurse) begin 9 (multi-recurse) exec("multi-recurse 8") (multi-recurse) begin 8 (multi-recurse) exec("multi-recurse 7") (multi-recurse) begin 7 (multi-recurse) exec("multi-recurse 6") (multi-recurse) begin 6 (multi-recurse) exec("multi-recurse 5") (multi-recurse) begin 5 (multi-recurse) exec("multi-recurse 4") (multi-recurse) begin 4 (multi-recurse) exec("multi-recurse 3") (multi-recurse) begin 3 (multi-recurse) exec("multi-recurse 2") (multi-recurse) begin 2 (multi-recurse) exec("multi-recurse 1") (multi-recurse) begin 1 (multi-recurse) exec("multi-recurse 0") (multi-recurse) begin 0 (multi-recurse) end 0 multi-recurse: exit(0) (multi-recurse) end 1 multi-recurse: exit(1) (multi-recurse) end 2 multi-recurse: exit(2) (multi-recurse) end 3 multi-recurse: exit(3) (multi-recurse) end 4 multi-recurse: exit(4) (multi-recurse) end 5 multi-recurse: exit(5) (multi-recurse) end 6 multi-recurse: exit(6) (multi-recurse) end 7 multi-recurse: exit(7) (multi-recurse) end 8 multi-recurse: exit(8) (multi-recurse) end 9 multi-recurse: exit(9) (multi-recurse) end 10 multi-recurse: exit(10) (multi-recurse) end 11 multi-recurse: exit(11) (multi-recurse) end 12 multi-recurse: exit(12) (multi-recurse) end 13 multi-recurse: exit(13) (multi-recurse) end 14 multi-recurse: exit(14) (multi-recurse) end 15 multi-recurse: exit(15) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/multi-recurse.ck.svn-base
Perl
oos
1,824
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (sc-boundary) begin sc-boundary: exit(42) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/sc-boundary.ck.svn-base
Perl
oos
139
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (args) begin (args) argc = 3 (args) argv[0] = 'args-dbl-space' (args) argv[1] = 'two' (args) argv[2] = 'spaces!' (args) argv[3] = null (args) end args-dbl-space: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/args-dbl-space.ck.svn-base
Perl
oos
267
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (read-boundary) begin (read-boundary) open "sample.txt" (read-boundary) end read-boundary: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/read-boundary.ck.svn-base
Perl
oos
196
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (write-stdin) begin (write-stdin) end write-stdin: exit(0) EOF (write-stdin) begin write-stdin: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/write-stdin.ck.svn-base
Perl
oos
211
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (write-bad-fd) begin (write-bad-fd) end write-bad-fd: exit(0) EOF (write-bad-fd) begin write-bad-fd: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/write-bad-fd.ck.svn-base
Perl
oos
216
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (create-exists) begin (create-exists) create quux.dat (create-exists) create warble.dat (create-exists) try to re-create quux.dat (create-exists) create baffle.dat (create-exists) try to re-create quux.dat (create-exists) end create-exists: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/create-exists.ck.svn-base
Perl
oos
346
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (read-bad-ptr) begin (read-bad-ptr) open "sample.txt" (read-bad-ptr) end read-bad-ptr: exit(0) EOF (read-bad-ptr) begin (read-bad-ptr) open "sample.txt" read-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/read-bad-ptr.ck.svn-base
Perl
oos
282
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (read-stdout) begin (read-stdout) end read-stdout: exit(0) EOF (read-stdout) begin read-stdout: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/read-stdout.ck.svn-base
Perl
oos
211
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (sc-bad-sp) begin sc-bad-sp: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/sc-bad-sp.ck.svn-base
Perl
oos
135
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (create-bound) begin (create-bound) create("quux.dat"): 1 (create-bound) end create-bound: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/create-bound.ck.svn-base
Perl
oos
196
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (open-boundary) begin (open-boundary) open "sample.txt" (open-boundary) end open-boundary: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/open-boundary.ck.svn-base
Perl
oos
196
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-read2) begin bad-read2: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/bad-read2.ck.svn-base
Perl
oos
160
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-jump) begin bad-jump: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/bad-jump.ck.svn-base
Perl
oos
158
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (open-bad-ptr) begin (open-bad-ptr) end open-bad-ptr: exit(0) EOF (open-bad-ptr) begin open-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/open-bad-ptr.ck.svn-base
Perl
oos
216
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (open-normal) begin (open-normal) end open-normal: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/open-normal.ck.svn-base
Perl
oos
156
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); system call! EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/null.ck.svn-base
Perl
oos
110
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (rox-simple) begin (rox-simple) open "rox-simple" (rox-simple) read "rox-simple" (rox-simple) try to write "rox-simple" (rox-simple) end rox-simple: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/.svn/text-base/rox-simple.ck.svn-base
Perl
oos
254
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (multi-child-fd) begin (multi-child-fd) open "sample.txt" (child-close) begin (child-close) end child-close: exit(0) (multi-child-fd) wait(exec()) = 0 (multi-child-fd) verified contents of "sample.txt" (multi-child-fd) end multi-child-fd: exit(0) EOF (multi-child-fd) begin (multi-child-fd) open "sample.txt" (child-close) begin child-close: exit(-1) (multi-child-fd) wait(exec()) = -1 (multi-child-fd) verified contents of "sample.txt" (multi-child-fd) end multi-child-fd: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/multi-child-fd.ck
Perl
oos
588
/* This program attempts to write to kernel memory. This should terminate the process with a -1 exit code. */ #include "tests/lib.h" #include "tests/main.h" void test_main (void) { *(int *)0xC0000000 = 42; fail ("should have exited with -1"); }
10cm
trunk/10cm/pintos/src/tests/userprog/bad-write2.c
C
oos
256
/* Creates an ordinary empty file. */ #include "tests/lib.h" #include "tests/main.h" void test_main (void) { CHECK (create ("quux.dat", 0), "create quux.dat"); }
10cm
trunk/10cm/pintos/src/tests/userprog/create-normal.c
C
oos
167
/* Wait for a subprocess to finish, twice. The first call must wait in the usual way and return the exit code. The second wait call must return -1 immediately. */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { pid_t child = exec ("child-simple"); msg ("wait(exec()) = %d", wait (child)); msg ("wait(exec()) = %d", wait (child)); }
10cm
trunk/10cm/pintos/src/tests/userprog/wait-twice.c
C
oos
391
/* Child process run by multi-child-fd test. Attempts to close the file descriptor passed as the first command-line argument. This is invalid, because file descriptors are not inherited in Pintos. Two results are allowed: either the system call should return without taking any action, or the kernel should terminate the process with a -1 exit code. */ #include <ctype.h> #include <stdio.h> #include <stdlib.h> #include <syscall.h> #include "tests/lib.h" const char *test_name = "child-close"; int main (int argc UNUSED, char *argv[]) { msg ("begin"); if (!isdigit (*argv[1])) fail ("bad command-line arguments"); close (atoi (argv[1])); msg ("end"); return 0; }
10cm
trunk/10cm/pintos/src/tests/userprog/child-close.c
C
oos
703
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-write) begin bad-write: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/bad-write.ck
Perl
oos
160
/* Tests argument passing to child processes. */ #include <syscall.h> #include "tests/main.h" void test_main (void) { wait (exec ("child-args childarg")); }
10cm
trunk/10cm/pintos/src/tests/userprog/exec-arg.c
C
oos
162
# -*- makefile -*- tests/%.output: FSDISK = 2 tests/%.output: PUTFILES = $(filter-out os.dsk, $^) tests/userprog_TESTS = $(addprefix tests/userprog/,args-none \ args-single args-multiple args-many args-dbl-space sc-bad-sp \ sc-bad-arg sc-boundary sc-boundary-2 halt exit create-normal \ create-empty create-null create-bad-ptr create-long create-exists \ create-bound open-normal open-missing open-boundary open-empty \ open-null open-bad-ptr open-twice close-normal close-twice close-stdin \ close-stdout close-bad-fd read-normal read-bad-ptr read-boundary \ read-zero read-stdout read-bad-fd write-normal write-bad-ptr \ write-boundary write-zero write-stdin write-bad-fd exec-once exec-arg \ exec-multiple exec-missing exec-bad-ptr wait-simple wait-twice \ wait-killed wait-bad-pid multi-recurse multi-child-fd rox-simple \ rox-child rox-multichild bad-read bad-write bad-read2 bad-write2 \ bad-jump bad-jump2) tests/userprog_PROGS = $(tests/userprog_TESTS) $(addprefix \ tests/userprog/,child-simple child-args child-bad child-close child-rox) tests/userprog/args-none_SRC = tests/userprog/args.c tests/userprog/args-single_SRC = tests/userprog/args.c tests/userprog/args-multiple_SRC = tests/userprog/args.c tests/userprog/args-many_SRC = tests/userprog/args.c tests/userprog/args-dbl-space_SRC = tests/userprog/args.c tests/userprog/sc-bad-sp_SRC = tests/userprog/sc-bad-sp.c tests/main.c tests/userprog/sc-bad-arg_SRC = tests/userprog/sc-bad-arg.c tests/main.c tests/userprog/bad-read_SRC = tests/userprog/bad-read.c tests/main.c tests/userprog/bad-write_SRC = tests/userprog/bad-write.c tests/main.c tests/userprog/bad-jump_SRC = tests/userprog/bad-jump.c tests/main.c tests/userprog/bad-read2_SRC = tests/userprog/bad-read2.c tests/main.c tests/userprog/bad-write2_SRC = tests/userprog/bad-write2.c tests/main.c tests/userprog/bad-jump2_SRC = tests/userprog/bad-jump2.c tests/main.c tests/userprog/sc-boundary_SRC = tests/userprog/sc-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/sc-boundary-2_SRC = tests/userprog/sc-boundary-2.c \ tests/userprog/boundary.c tests/main.c tests/userprog/halt_SRC = tests/userprog/halt.c tests/main.c tests/userprog/exit_SRC = tests/userprog/exit.c tests/main.c tests/userprog/create-normal_SRC = tests/userprog/create-normal.c tests/main.c tests/userprog/create-empty_SRC = tests/userprog/create-empty.c tests/main.c tests/userprog/create-null_SRC = tests/userprog/create-null.c tests/main.c tests/userprog/create-bad-ptr_SRC = tests/userprog/create-bad-ptr.c \ tests/main.c tests/userprog/create-long_SRC = tests/userprog/create-long.c tests/main.c tests/userprog/create-exists_SRC = tests/userprog/create-exists.c tests/main.c tests/userprog/create-bound_SRC = tests/userprog/create-bound.c \ tests/userprog/boundary.c tests/main.c tests/userprog/open-normal_SRC = tests/userprog/open-normal.c tests/main.c tests/userprog/open-missing_SRC = tests/userprog/open-missing.c tests/main.c tests/userprog/open-boundary_SRC = tests/userprog/open-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/open-empty_SRC = tests/userprog/open-empty.c tests/main.c tests/userprog/open-null_SRC = tests/userprog/open-null.c tests/main.c tests/userprog/open-bad-ptr_SRC = tests/userprog/open-bad-ptr.c tests/main.c tests/userprog/open-twice_SRC = tests/userprog/open-twice.c tests/main.c tests/userprog/close-normal_SRC = tests/userprog/close-normal.c tests/main.c tests/userprog/close-twice_SRC = tests/userprog/close-twice.c tests/main.c tests/userprog/close-stdin_SRC = tests/userprog/close-stdin.c tests/main.c tests/userprog/close-stdout_SRC = tests/userprog/close-stdout.c tests/main.c tests/userprog/close-bad-fd_SRC = tests/userprog/close-bad-fd.c tests/main.c tests/userprog/read-normal_SRC = tests/userprog/read-normal.c tests/main.c tests/userprog/read-bad-ptr_SRC = tests/userprog/read-bad-ptr.c tests/main.c tests/userprog/read-boundary_SRC = tests/userprog/read-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/read-zero_SRC = tests/userprog/read-zero.c tests/main.c tests/userprog/read-stdout_SRC = tests/userprog/read-stdout.c tests/main.c tests/userprog/read-bad-fd_SRC = tests/userprog/read-bad-fd.c tests/main.c tests/userprog/write-normal_SRC = tests/userprog/write-normal.c tests/main.c tests/userprog/write-bad-ptr_SRC = tests/userprog/write-bad-ptr.c tests/main.c tests/userprog/write-boundary_SRC = tests/userprog/write-boundary.c \ tests/userprog/boundary.c tests/main.c tests/userprog/write-zero_SRC = tests/userprog/write-zero.c tests/main.c tests/userprog/write-stdin_SRC = tests/userprog/write-stdin.c tests/main.c tests/userprog/write-bad-fd_SRC = tests/userprog/write-bad-fd.c tests/main.c tests/userprog/exec-once_SRC = tests/userprog/exec-once.c tests/main.c tests/userprog/exec-arg_SRC = tests/userprog/exec-arg.c tests/main.c tests/userprog/exec-multiple_SRC = tests/userprog/exec-multiple.c tests/main.c tests/userprog/exec-missing_SRC = tests/userprog/exec-missing.c tests/main.c tests/userprog/exec-bad-ptr_SRC = tests/userprog/exec-bad-ptr.c tests/main.c tests/userprog/wait-simple_SRC = tests/userprog/wait-simple.c tests/main.c tests/userprog/wait-twice_SRC = tests/userprog/wait-twice.c tests/main.c tests/userprog/wait-killed_SRC = tests/userprog/wait-killed.c tests/main.c tests/userprog/wait-bad-pid_SRC = tests/userprog/wait-bad-pid.c tests/main.c tests/userprog/multi-recurse_SRC = tests/userprog/multi-recurse.c tests/userprog/multi-child-fd_SRC = tests/userprog/multi-child-fd.c \ tests/main.c tests/userprog/rox-simple_SRC = tests/userprog/rox-simple.c tests/main.c tests/userprog/rox-child_SRC = tests/userprog/rox-child.c tests/main.c tests/userprog/rox-multichild_SRC = tests/userprog/rox-multichild.c \ tests/main.c tests/userprog/child-simple_SRC = tests/userprog/child-simple.c tests/userprog/child-args_SRC = tests/userprog/args.c tests/userprog/child-bad_SRC = tests/userprog/child-bad.c tests/main.c tests/userprog/child-close_SRC = tests/userprog/child-close.c tests/userprog/child-rox_SRC = tests/userprog/child-rox.c $(foreach prog,$(tests/userprog_PROGS),$(eval $(prog)_SRC += tests/lib.c)) tests/userprog/args-single_ARGS = onearg tests/userprog/args-multiple_ARGS = some arguments for you! tests/userprog/args-many_ARGS = a b c d e f g h i j k l m n o p q r s t u v tests/userprog/args-dbl-space_ARGS = two spaces! tests/userprog/multi-recurse_ARGS = 15 tests/userprog/open-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/open-boundary_PUTFILES += tests/userprog/sample.txt tests/userprog/open-twice_PUTFILES += tests/userprog/sample.txt tests/userprog/close-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/close-twice_PUTFILES += tests/userprog/sample.txt tests/userprog/read-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/read-bad-ptr_PUTFILES += tests/userprog/sample.txt tests/userprog/read-boundary_PUTFILES += tests/userprog/sample.txt tests/userprog/read-zero_PUTFILES += tests/userprog/sample.txt tests/userprog/write-normal_PUTFILES += tests/userprog/sample.txt tests/userprog/write-bad-ptr_PUTFILES += tests/userprog/sample.txt tests/userprog/write-boundary_PUTFILES += tests/userprog/sample.txt tests/userprog/write-zero_PUTFILES += tests/userprog/sample.txt tests/userprog/multi-child-fd_PUTFILES += tests/userprog/sample.txt tests/userprog/exec-once_PUTFILES += tests/userprog/child-simple tests/userprog/exec-multiple_PUTFILES += tests/userprog/child-simple tests/userprog/wait-simple_PUTFILES += tests/userprog/child-simple tests/userprog/wait-twice_PUTFILES += tests/userprog/child-simple tests/userprog/exec-arg_PUTFILES += tests/userprog/child-args tests/userprog/multi-child-fd_PUTFILES += tests/userprog/child-close tests/userprog/wait-killed_PUTFILES += tests/userprog/child-bad tests/userprog/rox-child_PUTFILES += tests/userprog/child-rox tests/userprog/rox-multichild_PUTFILES += tests/userprog/child-rox
10cm
trunk/10cm/pintos/src/tests/userprog/Make.tests
Makefile
oos
7,935
/* Invokes a system call with the system call number and its argument on separate pages. This must work. */ #include <syscall-nr.h> #include "tests/userprog/boundary.h" #include "tests/lib.h" #include "tests/main.h" void test_main (void) { /* Put a syscall number at the end of one page and its argument at the beginning of another. */ int *p = get_boundary_area (); p--; p[0] = SYS_EXIT; p[1] = 42; /* Invoke the system call. */ asm volatile ("movl %0, %%esp; int $0x30" : : "g" (p)); fail ("should have called exit(42)"); }
10cm
trunk/10cm/pintos/src/tests/userprog/sc-boundary.c
C
oos
555
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (exec-bad-ptr) begin (exec-bad-ptr) end exec-bad-ptr: exit(0) EOF (exec-bad-ptr) begin exec-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/exec-bad-ptr.ck
Perl
oos
216
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (wait-killed) begin (child-bad) begin child-bad: exit(-1) (wait-killed) wait(exec()) = -1 (wait-killed) end wait-killed: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/wait-killed.ck
Perl
oos
226
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (create-bad-ptr) begin create-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/create-bad-ptr.ck
Perl
oos
145
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (rox-simple) begin (rox-simple) open "rox-simple" (rox-simple) read "rox-simple" (rox-simple) try to write "rox-simple" (rox-simple) end rox-simple: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/rox-simple.ck
Perl
oos
254
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (open-twice) begin (open-twice) open "sample.txt" once (open-twice) open "sample.txt" again (open-twice) end open-twice: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/open-twice.ck
Perl
oos
226
/* Wait for a process that will be killed for bad behavior. */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { msg ("wait(exec()) = %d", wait (exec ("child-bad"))); }
10cm
trunk/10cm/pintos/src/tests/userprog/wait-killed.c
C
oos
216
/* Prints the command-line arguments. This program is used for all of the args-* tests. Grading is done differently for each of the args-* tests based on the output. */ #include "tests/lib.h" int main (int argc, char *argv[]) { int i; test_name = "args"; msg ("begin"); msg ("argc = %d", argc); for (i = 0; i <= argc; i++) if (argv[i] != NULL) msg ("argv[%d] = '%s'", i, argv[i]); else msg ("argv[%d] = null", i); msg ("end"); return 0; }
10cm
trunk/10cm/pintos/src/tests/userprog/args.c
C
oos
489
/* This program attempts to execute code at address 0, which is not mapped. This should terminate the process with a -1 exit code. */ #include "tests/lib.h" #include "tests/main.h" void test_main (void) { msg ("Congratulations - you have successfully called NULL: %d", ((int (*)(void))NULL)()); fail ("should have exited with -1"); }
10cm
trunk/10cm/pintos/src/tests/userprog/bad-jump.c
C
oos
353
/* Reads data spanning two pages in virtual address space, which must succeed. */ #include <string.h> #include <syscall.h> #include "tests/userprog/boundary.h" #include "tests/userprog/sample.inc" #include "tests/lib.h" #include "tests/main.h" void test_main (void) { int handle; int byte_cnt; char *buffer; CHECK ((handle = open ("sample.txt")) > 1, "open \"sample.txt\""); buffer = get_boundary_area () - sizeof sample / 2; byte_cnt = read (handle, buffer, sizeof sample - 1); if (byte_cnt != sizeof sample - 1) fail ("read() returned %d instead of %zu", byte_cnt, sizeof sample - 1); else if (strcmp (sample, buffer)) { msg ("expected text:\n%s", sample); msg ("text actually read:\n%s", buffer); fail ("expected text differs from actual"); } }
10cm
trunk/10cm/pintos/src/tests/userprog/read-boundary.c
C
oos
803
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (write-zero) begin (write-zero) open "sample.txt" (write-zero) end write-zero: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/write-zero.ck
Perl
oos
184
/* Tries to close an invalid fd, which must either fail silently or terminate with exit code -1. */ #include <syscall.h> #include "tests/main.h" void test_main (void) { close (0x20101234); }
10cm
trunk/10cm/pintos/src/tests/userprog/close-bad-fd.c
C
oos
199
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (open-normal) begin (open-normal) end open-normal: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/open-normal.ck
Perl
oos
156
/* Ensure that the executable of a running process cannot be modified, even in the presence of multiple children. */ #define CHILD_CNT "5" #include "tests/userprog/rox-child.inc"
10cm
trunk/10cm/pintos/src/tests/userprog/rox-multichild.c
C
oos
183
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (exec-arg) begin (args) begin (args) argc = 2 (args) argv[0] = 'child-args' (args) argv[1] = 'childarg' (args) argv[2] = null (args) end child-args: exit(0) (exec-arg) end exec-arg: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/exec-arg.ck
Perl
oos
287
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF']); (args) begin (args) argc = 23 (args) argv[0] = 'args-many' (args) argv[1] = 'a' (args) argv[2] = 'b' (args) argv[3] = 'c' (args) argv[4] = 'd' (args) argv[5] = 'e' (args) argv[6] = 'f' (args) argv[7] = 'g' (args) argv[8] = 'h' (args) argv[9] = 'i' (args) argv[10] = 'j' (args) argv[11] = 'k' (args) argv[12] = 'l' (args) argv[13] = 'm' (args) argv[14] = 'n' (args) argv[15] = 'o' (args) argv[16] = 'p' (args) argv[17] = 'q' (args) argv[18] = 'r' (args) argv[19] = 's' (args) argv[20] = 't' (args) argv[21] = 'u' (args) argv[22] = 'v' (args) argv[23] = null (args) end args-many: exit(0) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/args-many.ck
Perl
oos
684
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (close-twice) begin (close-twice) open "sample.txt" (close-twice) close "sample.txt" (close-twice) close "sample.txt" again (close-twice) end close-twice: exit(0) EOF (close-twice) begin (close-twice) open "sample.txt" (close-twice) close "sample.txt" (close-twice) close "sample.txt" again close-twice: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/close-twice.ck
Perl
oos
419
/* Executes and waits for a single child process. */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { wait (exec ("child-simple")); }
10cm
trunk/10cm/pintos/src/tests/userprog/exec-once.c
C
oos
182
/* Executes and waits for multiple child processes. */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { wait (exec ("child-simple")); wait (exec ("child-simple")); wait (exec ("child-simple")); wait (exec ("child-simple")); }
10cm
trunk/10cm/pintos/src/tests/userprog/exec-multiple.c
C
oos
280
/* Try writing to fd 0 (stdin), which may just fail or terminate the process with -1 exit code. */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { char buf = 123; write (0, &buf, 1); }
10cm
trunk/10cm/pintos/src/tests/userprog/write-stdin.c
C
oos
243
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected (IGNORE_USER_FAULTS => 1, [<<'EOF']); (bad-jump2) begin bad-jump2: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/bad-jump2.ck
Perl
oos
160
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (write-bad-ptr) begin (write-bad-ptr) open "sample.txt" (write-bad-ptr) end write-bad-ptr: exit(0) EOF (write-bad-ptr) begin (write-bad-ptr) open "sample.txt" write-bad-ptr: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/write-bad-ptr.ck
Perl
oos
289
/* Tries to open a file with the empty string as its name. */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { int handle = open (""); if (handle != -1) fail ("open() returned %d instead of -1", handle); }
10cm
trunk/10cm/pintos/src/tests/userprog/open-empty.c
C
oos
260
# -*- perl -*- use strict; use warnings; use tests::tests; check_expected ([<<'EOF', <<'EOF']); (read-bad-fd) begin (read-bad-fd) end read-bad-fd: exit(0) EOF (read-bad-fd) begin read-bad-fd: exit(-1) EOF pass;
10cm
trunk/10cm/pintos/src/tests/userprog/read-bad-fd.ck
Perl
oos
211
/* Waits for an invalid pid. This may fail or terminate the process with -1 exit code. */ #include <syscall.h> #include "tests/main.h" void test_main (void) { wait ((pid_t) 0x0c020301); }
10cm
trunk/10cm/pintos/src/tests/userprog/wait-bad-pid.c
C
oos
197
/* Open a file. */ #include <syscall.h> #include "tests/lib.h" #include "tests/main.h" void test_main (void) { int handle = open ("sample.txt"); if (handle < 2) fail ("open() returned %d", handle); }
10cm
trunk/10cm/pintos/src/tests/userprog/open-normal.c
C
oos
211
/* Executes itself recursively to the depth indicated by the first command-line argument. */ #include <debug.h> #include <stdlib.h> #include <stdio.h> #include <syscall.h> #include "tests/lib.h" const char *test_name = "multi-recurse"; int main (int argc UNUSED, char *argv[]) { int n = atoi (argv[1]); msg ("begin %d", n); if (n != 0) { char child_cmd[128]; pid_t child_pid; int code; snprintf (child_cmd, sizeof child_cmd, "multi-recurse %d", n - 1); CHECK ((child_pid = exec (child_cmd)) != -1, "exec(\"%s\")", child_cmd); code = wait (child_pid); if (code != n - 1) fail ("wait(exec(\"%s\")) returned %d", child_cmd, code); } msg ("end %d", n); return n; }
10cm
trunk/10cm/pintos/src/tests/userprog/multi-recurse.c
C
oos
749
char sample[] = { "\"Amazing Electronic Fact: If you scuffed your feet long enough without\n" " touching anything, you would build up so many electrons that your\n" " finger would explode! But this is nothing to worry about unless you\n" " have carpeting.\" --Dave Barry\n" };
10cm
trunk/10cm/pintos/src/tests/userprog/sample.inc
PHP
oos
287