Skip to content

Commit

Permalink
Merge pull request #1249 from google/reduction-tweaks
Browse files Browse the repository at this point in the history
Tweaks to reduction
  • Loading branch information
adetaylor authored Feb 21, 2023
2 parents 143b294 + 0f1a28a commit b429077
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tools/reduce/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -511,17 +511,19 @@ fn create_interestingness_test(
let problem_grep = problem
.map(|problem| format!("| grep -q \"{problem}\" >/dev/null 2>&1"))
.unwrap_or_default();
// We formerly had a 'trap' below but it seems to have caused problems
// (trap \"if [[ \\$? -eq 139 ]]; then echo Segfault; fi\" CHLD; {} {} 2>&1 && cat autocxx-ffi-default-gen.rs && cat autocxxgen*.h && {} && {} 2>&1 ) {}
let content = format!(
indoc! {"
#!/bin/sh
#!/bin/bash
set -e
echo Precompile
{}
echo Move
mv concat.h concat-body.h
(echo \"#ifndef __CONCAT_H__\"; echo \"#define __CONCAT_H__\"; echo '#include \"concat-body.h\"'; echo \"#endif\") > concat.h
echo Codegen
(trap \"if [[ \\$? -eq 139 ]]; then echo Segfault; fi\" CHLD; {} {} 2>&1 && cat autocxx-ffi-default-gen.rs && cat autocxxgen*.h && {} && {} 2>&1 ) {}
({} {} 2>&1 && cat autocxx-ffi-default-gen.rs && cat autocxxgen*.h && {} && {} 2>&1) {}
echo Remove
rm concat.h
echo Swap back
Expand Down

0 comments on commit b429077

Please sign in to comment.