Add tests files
This commit is contained in:
parent
99b0128cfe
commit
a001e45c3f
1
test/riscv_instructions/.gitignore
vendored
1
test/riscv_instructions/.gitignore
vendored
@ -1,5 +1,6 @@
|
|||||||
*
|
*
|
||||||
!.gitignore
|
!.gitignore
|
||||||
!*.c
|
!*.c
|
||||||
|
!*/
|
||||||
!*.md
|
!*.md
|
||||||
!**/Makefile
|
!**/Makefile
|
@ -2,18 +2,22 @@ build:
|
|||||||
make build -C boolean_logic/
|
make build -C boolean_logic/
|
||||||
make build -C jump_instructions/
|
make build -C jump_instructions/
|
||||||
make build -C simple_arithmetics/
|
make build -C simple_arithmetics/
|
||||||
|
make build -C syscall_tests/
|
||||||
|
|
||||||
dumps:
|
dumps:
|
||||||
make dumps -C boolean_logic/
|
make dumps -C boolean_logic/
|
||||||
make dumps -C jump_instructions/
|
make dumps -C jump_instructions/
|
||||||
make dumps -C simple_arithmetics/
|
make dumps -C simple_arithmetics/
|
||||||
|
make dumps -C syscall_tests/
|
||||||
|
|
||||||
tests:
|
tests:
|
||||||
make tests -C boolean_logic/
|
make tests -C boolean_logic/
|
||||||
make tests -C jump_instructions/
|
make tests -C jump_instructions/
|
||||||
make tests -C simple_arithmetics/
|
make tests -C simple_arithmetics/
|
||||||
|
make tests -C syscall_tests/
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
$(MAKE) clean -C boolean_logic/
|
$(MAKE) clean -C boolean_logic/
|
||||||
$(MAKE) clean -C jump_instructions/
|
$(MAKE) clean -C jump_instructions/
|
||||||
$(MAKE) clean -C simple_arithmetics/
|
$(MAKE) clean -C simple_arithmetics/
|
||||||
|
$(MAKE) clean -C syscall_tests/
|
16
test/riscv_instructions/syscall_tests/Makefile
Normal file
16
test/riscv_instructions/syscall_tests/Makefile
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
|
||||||
|
PROGRAMS = halt prints
|
||||||
|
|
||||||
|
build: $(PROGRAMS)
|
||||||
|
|
||||||
|
dumps: halt.dump prints.dump
|
||||||
|
|
||||||
|
tests: halt.guac prints.guac
|
||||||
|
|
||||||
|
clean:
|
||||||
|
$(RM) halt.o halt prints prints.o
|
||||||
|
|
||||||
|
TOPDIR = ../..
|
||||||
|
include $(TOPDIR)/Makefile.tests
|
||||||
|
|
||||||
|
$(PROGRAMS): % : $(USERLIB)/sys.o $(USERLIB)/libnachos.o %.o
|
7
test/riscv_instructions/syscall_tests/halt.c
Normal file
7
test/riscv_instructions/syscall_tests/halt.c
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
|
||||||
|
#include "userlib/syscall.h"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
Shutdown();
|
||||||
|
return 0;
|
||||||
|
}
|
10
test/riscv_instructions/syscall_tests/prints.c
Normal file
10
test/riscv_instructions/syscall_tests/prints.c
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#include "userlib/syscall.h"
|
||||||
|
#include "userlib/libnachos.h"
|
||||||
|
|
||||||
|
int main() {
|
||||||
|
n_printf("Hello World 1");
|
||||||
|
n_printf("Hello World 2");
|
||||||
|
n_printf("Hello World 3");
|
||||||
|
n_printf("Hello World 4");
|
||||||
|
return 0;
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user