Add all the assignment code.
Signed-off-by: jmug <u.g.a.mariano@gmail.com>
This commit is contained in:
parent
58c6b1f81c
commit
cfe502c598
1277 changed files with 48709 additions and 1 deletions
57
hw2/test/studenttests.ml
Normal file
57
hw2/test/studenttests.ml
Normal file
|
|
@ -0,0 +1,57 @@
|
|||
open Util.Assert
|
||||
open X86
|
||||
open Sim.Simulator
|
||||
open Gradedtests
|
||||
open Asm
|
||||
(* These tests are provided by you -- they will be graded manually *)
|
||||
|
||||
(* You should also add additional test cases here to help you *)
|
||||
(* debug your program. *)
|
||||
|
||||
|
||||
let test_my =
|
||||
let bin = [
|
||||
InsB0 (Movq, Asm.[ ~$42; ~%Rax ]);
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
]
|
||||
|
||||
in
|
||||
|
||||
let asm = [gtext "main"
|
||||
[
|
||||
Movq, [~$42; ~%Rax]];
|
||||
] in
|
||||
|
||||
(assert_eqf (fun() -> (assemble asm).text_seg) bin )
|
||||
|
||||
|
||||
let mov_ri =
|
||||
test_machine
|
||||
[
|
||||
InsB0 (Movq, Asm.[ ~$42; ~%Rax ]);
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
InsFrag;
|
||||
]
|
||||
|
||||
let provided_tests : suite = [
|
||||
|
||||
Test ("My Tests", [
|
||||
("assert", test_my)
|
||||
]);
|
||||
|
||||
Test ("Student-Provided Big Test for Part III: Score recorded as PartIIITestCase", [
|
||||
|
||||
]);
|
||||
|
||||
]
|
||||
Loading…
Add table
Add a link
Reference in a new issue