aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorEgor Tensin <Egor.Tensin@gmail.com>2023-07-26 12:50:29 +0200
committerEgor Tensin <Egor.Tensin@gmail.com>2023-07-26 12:50:29 +0200
commitb4b934a786d00992d205f4927efc37bb433399e1 (patch)
tree5432ae1c8f73d75c4440fc790b650ebb89c44bec
parentprocess: portable exit code processing (diff)
downloadcimple-b4b934a786d00992d205f4927efc37bb433399e1.tar.gz
cimple-b4b934a786d00992d205f4927efc37bb433399e1.zip
test: test a weird exit code
Diffstat (limited to '')
-rw-r--r--test/py/lib/test_repo.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/py/lib/test_repo.py b/test/py/lib/test_repo.py
index af0da68..fc3e074 100644
--- a/test/py/lib/test_repo.py
+++ b/test/py/lib/test_repo.py
@@ -28,7 +28,8 @@ class Repo:
Process.run(*args, cwd=self.path, **kwargs)
-CI_SCRIPT = r'''#!/bin/sh -e
+CI_SCRIPT = r'''#!/usr/bin/env bash
+set -o errexit -o nounset -o pipefail
readonly runs_dir={runs_dir}
readonly run_output_template=run_XXXXXX
run_output_path="$( mktemp --tmpdir="$runs_dir" "$run_output_template" )"
@@ -178,6 +179,7 @@ OUTPUT_SCRIPT_NULL = r'''#!/usr/bin/env python3
output = {output}
import sys
sys.stdout.buffer.write(output)
+sys.exit(-2)
'''
@@ -198,6 +200,9 @@ class TestRepoOutputNull(TestRepoOutput):
def format_output_script(self):
return OUTPUT_SCRIPT_NULL.format(output=repr(self.output))
+ def run_exit_code_matches(self, ec):
+ return ec == 254
+
def run_output_matches(self, output):
return output == self.output