Skip to content

Instantly share code, notes, and snippets.

@joachimschmidt557
Created February 5, 2022 23:24
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save joachimschmidt557/d5673ba66d3c3012d40db9c2a5cb5755 to your computer and use it in GitHub Desktop.
Save joachimschmidt557/d5673ba66d3c3012d40db9c2a5cb5755 to your computer and use it in GitHub Desktop.
Automatically enable passing behavior tests
#!/usr/bin/env bash
IFS=":"
rg --json "if \(builtin.zig_backend == .stage2_arm\) return error.SkipZigTest;" test/behavior/ | jq -r 'select(.type == "match") | "\(.data.path.text):\(.data.line_number)"' | while read -r file line; do
cp "$file" "$file.bak"
sed -i "$line s/^/\/\//" "$file"
if "$PWD/zig-out/bin/zig" test -target arm-linux-gnu test/behavior.zig; then
rm "$file.bak"
else
mv "$file.bak" "$file"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment