From 97b8d5bb3c9fd96251e89539d122d2331a2a7925 Mon Sep 17 00:00:00 2001 From: Roland Reichwein Date: Fri, 13 Nov 2020 11:27:39 +0100 Subject: Add system tests, implement syscall --- systemtest/mcc-execute.tests/exitcodes.exp | 18 ++++++++++++++++++ systemtest/mcc-execute.tests/test.cpp | 1 + systemtest/mcc-execute.tests/test1.cpp | 1 + 3 files changed, 20 insertions(+) create mode 100644 systemtest/mcc-execute.tests/exitcodes.exp create mode 100644 systemtest/mcc-execute.tests/test.cpp create mode 100644 systemtest/mcc-execute.tests/test1.cpp (limited to 'systemtest/mcc-execute.tests') diff --git a/systemtest/mcc-execute.tests/exitcodes.exp b/systemtest/mcc-execute.tests/exitcodes.exp new file mode 100644 index 0000000..6e8b632 --- /dev/null +++ b/systemtest/mcc-execute.tests/exitcodes.exp @@ -0,0 +1,18 @@ +# https://www.embecosm.com/appnotes/ean8/ean8-howto-dejagnu-1.0.html + +spawn systemtest/mcc-execute.tests/test1 + +expect eof + +lassign [wait] pid spawnid os_error_flag value + +if {$os_error_flag == 0} { + if {$value == 3} { + pass "exit status: $value" + } else { + fail "exit status: $value" + } +} else { + fail "errno: $value" +} + diff --git a/systemtest/mcc-execute.tests/test.cpp b/systemtest/mcc-execute.tests/test.cpp new file mode 100644 index 0000000..40cbb54 --- /dev/null +++ b/systemtest/mcc-execute.tests/test.cpp @@ -0,0 +1 @@ +int main() { return 1; } diff --git a/systemtest/mcc-execute.tests/test1.cpp b/systemtest/mcc-execute.tests/test1.cpp new file mode 100644 index 0000000..3a03f6f --- /dev/null +++ b/systemtest/mcc-execute.tests/test1.cpp @@ -0,0 +1 @@ +int main() { return 1 + 2; } -- cgit v1.2.3