Browse Source

Test written and generally working, now to integrate in CircleCI

Luiserebii 11 months ago
parent
commit
4e2769b2bf
Signed by: Luiserebii <luis@serebii.io> GPG Key ID: 525A84BC981B7D3E
5 changed files with 28 additions and 5 deletions
  1. 1
    1
      .gitignore
  2. 2
    1
      test/Makefile
  3. 7
    3
      test/src/test-1.s
  4. 18
    0
      test/src/test-2.s
  5. BIN
      test/test-1.out

+ 1
- 1
.gitignore View File

@@ -1,5 +1,5 @@
1 1
 *.swo
2 2
 *.swp
3
-a.out
3
+*.out
4 4
 *.o
5 5
 *.so

+ 2
- 1
test/Makefile View File

@@ -15,6 +15,7 @@ link:
15 15
 	ld $(LDFLAGS) ../build/$(NAME).o build/test.o
16 16
 
17 17
 test-n: test-n.o link-n
18
+	
18 19
 
19 20
 test-n.o:
20 21
 	as $(ASFLAGS) src/test-1.s -o build/test-1.o 
@@ -25,4 +26,4 @@ link-n:
25 26
 	ld $(LDFLAGS) ../build/$(NAME).o build/test-2.o -o test-2.out
26 27
 
27 28
 clean:
28
-	rm -rf build/*
29
+	rm -rf build/* && rm ./*.out

+ 7
- 3
test/src/test-1.s View File

@@ -1,4 +1,4 @@
1
-.include "macro-util.s"
1
+.include "./src/macro-util.s"
2 2
 .section .data
3 3
 title1:
4 4
 	.ascii "numbers are as expected\0"
@@ -7,8 +7,12 @@ title1:
7 7
 .globl _start
8 8
 
9 9
 _start:
10
-	stdcall test_assert_equal_uint $1, $2, $title1
10
+	stdcall test_assert_equal_uint $1, $1, $title1
11
+	stdcall test_assert_equal_uint $1, $1, $title1
12
+	stdcall test_assert_equal_uint $1, $1, $title1
11 13
 
14
+	stdcall test_end
15
+
16
+	movl %eax, %ebx
12 17
 	movl $1, %eax
13
-	movl $0, %ebx
14 18
 	int $0x80

+ 18
- 0
test/src/test-2.s View File

@@ -0,0 +1,18 @@
1
+.include "./src/macro-util.s"
2
+.section .data
3
+title1:
4
+	.ascii "numbers are as expected\0"
5
+
6
+.section .text
7
+.globl _start
8
+
9
+_start:
10
+	stdcall test_assert_equal_uint $1, $1, $title1
11
+	stdcall test_assert_equal_uint $1, $2, $title1
12
+	stdcall test_assert_equal_uint $1, $4, $title1
13
+
14
+	stdcall test_end
15
+
16
+	movl %eax, %ebx
17
+	movl $1, %eax
18
+	int $0x80

BIN
test/test-1.out View File


Loading…
Cancel
Save