Add conditional code for tests.asm (include certain tests or not)

This commit is contained in:
2025-07-05 02:30:18 +02:00
parent 2e9d88ed76
commit a193054304

View File

@@ -11,6 +11,7 @@ extern strlen
section .rodata section .rodata
TEST_print equ 1 TEST_print equ 1
TEST_puts equ 1
TEST_strlen equ 1 TEST_strlen equ 1
; print() ; print()
@@ -37,24 +38,30 @@ _start:
;--- ;---
;--- print() ;--- print()
;--- ;---
%if TEST_print
lea rdi, [rel msgPrint] lea rdi, [rel msgPrint]
call print call print
%endif
;--- ;---
;--- puts() ;--- puts()
;--- ;---
%if TEST_puts
lea rdi, [rel msgPuts] lea rdi, [rel msgPuts]
call puts call puts
%endif
;--- ;---
;--- strlen() ;--- strlen()
;--- ;---
%if TEST_strlen
; TEST 1 ; TEST 1
lea rdi, [rel strlenStr1] lea rdi, [rel strlenStr1]
call strlen call strlen
; TEST 2 ; TEST 2
lea rdi, [rel strlenStr2] lea rdi, [rel strlenStr2]
call strlen call strlen
%endif
;--- ;---
;--- exit() ;--- exit()