gnu_debuglink_test.sh 631 B

1234567891011121314151617
  1. #!/bin/bash
  2. crash="$1"
  3. rm -f "$crash."{debuginfo,strip}
  4. objcopy --only-keep-debug "$crash" "$crash.debuginfo"
  5. objcopy --strip-debug --add-gnu-debuglink="$crash.debuginfo" "$crash" "$crash.strip"
  6. echo '{"op":"start","test":"gnu_debuglink_test"}';
  7. start=$(date +%s)
  8. if "$crash.strip" 2>&1 | grep 'Crash.cpp:[0-9]*$' > /dev/null; then
  9. result='"status":"passed"';
  10. else
  11. result='"status":"failed"';
  12. fi
  13. end=$(date +%s)
  14. echo '{"op":"test_done","test":"gnu_debuglink_test",'"$result"'}'
  15. echo '{"op":"all_done","results":[{"name":"gnu_debuglink_test",'"$result"',"start_time":'"$start"',"end_time":'"$end"',"details":"nothing"}]}'