TESTS="std_io stdout_stderr_join"

simulate_cmds="sbatch rm" # Simulate rm in order not to get job script deleted
read -r -d '' simulator_output <<'EOF'
rargs="/sbatch .*/"
output="Submitted batch job 1"

rargs="/rm .*/"
output=""
EOF

read -r -d '' general_arc_test_configuration <<EOF
[lrms]
slurm_bin_path=@PWD@/bin
EOF

function test_std_io() {
read -r -d '' job_description_input <<'EOF'
&(executable = "/bin/true")
(stdin="in")
(stdout="out")
(stderr="error")
EOF

cat "${SRCDIR}/std-io-test-std_io.patch" | patch -sf -p1 -d ${SRCDIR} -o ${testdir}/expected_lrms_job_script.tmpl
}

function test_stdout_stderr_join() {
read -r -d '' job_description_input <<'EOF'
&(executable = "/bin/true")
(stdin="in")
(stdout="out")
(join="yes")
EOF

cat "${SRCDIR}/std-io-test-stdout_stderr_join.patch" | patch -sf -p1 -d ${SRCDIR} -o ${testdir}/expected_lrms_job_script.tmpl
}
