forked from aengelke/instrew
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: Add first full integration tests
- Loading branch information
Showing
12 changed files
with
91 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -63,3 +63,4 @@ subdir('tool-api') | |
subdir('server') | ||
|
||
subdir('tools-simple') | ||
subdir('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
.text | ||
.global _start | ||
_start: | ||
mov x0, #0 | ||
mov x8, #94 | ||
svc #0 | ||
udf #0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
|
||
triple = 'aarch64-linux-gnu' | ||
cases = [ | ||
{'name': 'exit', 'src': files('exit.S')}, | ||
] |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
|
||
clang = find_program('clang', native: true, required: false, disabler: true) | ||
if not clang.found() | ||
warning('unable to find clang; disabling tests') | ||
endif | ||
|
||
foreach arch : ['aarch64', 'x86_64'] | ||
subdir(arch) | ||
|
||
testcc = [clang, '--target=@0@'.format(triple), '-nostdlib', '-static', '-fuse-ld=lld'] | ||
testrun = run_command(testcc + ['-o', '/dev/null', files('empty.s')], check: false) | ||
if testrun.returncode() != 0 | ||
warning('defunctional @0@ Clang/LLD; disabling tests'.format(arch)) | ||
continue | ||
endif | ||
|
||
foreach case : cases | ||
name = '@0@-@1@'.format(arch, case.get('name')) | ||
exec = custom_target(name, | ||
input: case.get('src'), | ||
output: name, | ||
depfile: name + '.d', | ||
command: testcc + ['-MD', '-MF', '@DEPFILE@', '-o', '@OUTPUT@', '@INPUT@'] + case.get('compile_args', [])) | ||
test(name, instrew, suite: [arch], | ||
args: case.get('instrew_args', []) + [exec] + case.get('args', []), | ||
should_fail: case.get('should_fail', false)) | ||
endforeach | ||
endforeach |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
.intel_syntax noprefix | ||
.text | ||
.global _start | ||
_start: | ||
mov eax, 0x1000000 | ||
1: call 2f | ||
2: pop rcx | ||
sub eax, 1 | ||
jnz 1b | ||
|
||
xor edi, edi | ||
mov eax, 231 | ||
syscall | ||
ud2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
.intel_syntax noprefix | ||
.text | ||
.global _start | ||
_start: | ||
xor edi, edi | ||
mov eax, 231 | ||
syscall | ||
ud2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
triple = 'x86_64-linux-gnu' | ||
cases = [ | ||
{'name': 'exit', 'src': files('exit.S')}, | ||
{'name': 'call-pop', 'src': files('call-pop.S')}, | ||
{'name': 'nowrite', 'src': files('nowrite.S'), 'should_fail': true}, | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
.intel_syntax noprefix | ||
.text | ||
.global _start | ||
_start: | ||
mov byte ptr [rip + data], 0 | ||
// should not be reached | ||
xor edi, edi | ||
mov eax, 231 | ||
syscall | ||
|
||
.rodata | ||
data: | ||
.byte 0xff |