Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
Ampretuzo committed May 16, 2022
1 parent a46b29b commit f8dfa71
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 16 deletions.
1 change: 1 addition & 0 deletions initial-xv6/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/tests-out
4 changes: 4 additions & 0 deletions initial-xv6/src/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -15,3 +15,7 @@ mkfs
kernel/kernel
user/usys.S
.gdbinit


Makefile.test
/user/test_*.c
4 changes: 2 additions & 2 deletions initial-xv6/tests/pre
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
../tester/xv6-edit-makefile.sh src/Makefile test_1,test_2 > src/Makefile.test
cp -f tests/test_1.c src/test_1.c
cp -f tests/test_2.c src/test_2.c
cp -f tests/test_1.c src/user/test_1.c
cp -f tests/test_2.c src/user/test_2.c
cd src
make -f Makefile.test clean
make -f Makefile.test xv6.img
Expand Down
10 changes: 5 additions & 5 deletions initial-xv6/tests/test_1.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "types.h"
#include "stat.h"
#include "user.h"
#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"

int
main(int argc, char *argv[]) {
Expand All @@ -14,6 +14,6 @@ main(int argc, char *argv[]) {
(void) read(4, buf, 1);
}
int x4 = getreadcount();
printf(1, "XV6_TEST_OUTPUT %d %d %d\n", x2-x1, x3-x2, x4-x3);
exit();
fprintf(1, "XV6_TEST_OUTPUT %d %d %d\n", x2-x1, x3-x2, x4-x3);
exit(0);
}
12 changes: 6 additions & 6 deletions initial-xv6/tests/test_2.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#include "types.h"
#include "stat.h"
#include "user.h"
#include "kernel/types.h"
#include "kernel/stat.h"
#include "user/user.h"

int
main(int argc, char *argv[]) {
Expand All @@ -18,10 +18,10 @@ main(int argc, char *argv[]) {
// (void) shutdown();

if (rc > 0) {
(void) wait();
(void) wait(0);
int x2 = getreadcount();
total += (x2 - x1);
printf(1, "XV6_TEST_OUTPUT %d\n", total);
fprintf(1, "XV6_TEST_OUTPUT %d\n", total);
}
exit();
exit(0);
}
2 changes: 1 addition & 1 deletion tester/run-xv6-command.exp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ proc shutdown {} {
set timeout -1

# build and launch xv6 on qemu
spawn make [lindex $argv 0] -f [lindex $argv 1] qemu-nox
spawn make [lindex $argv 0] -f [lindex $argv 1] qemu

trap {
shutdown
Expand Down
4 changes: 2 additions & 2 deletions tester/xv6-edit-makefile.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ infile=$1
testnames=$2

gawk -vtestnames=$testnames '
($1 == "_mkdir\\") {
($1 == "\$\U\/_mkdir\\") {
n = split(testnames, x, ",");
for (i = 1; i <= n; i++) {
printf("\t_%s\\\n", x[i]);
printf("\t\$U\/_%s\\\n", x[i]);
}
}
Expand Down

0 comments on commit f8dfa71

Please sign in to comment.