symforce-org / symforce

Fast symbolic computation, code generation, and nonlinear optimization for robotics
https://symforce.org
Apache License 2.0
1.41k stars 145 forks source link

Fix make test_update on macos #264

Closed bradley-solliday-skydio closed 1 year ago

bradley-solliday-skydio commented 1 year ago

The core problem seemed to be that on macos, sed doesn't recognize the \w escape character (meaning a letter in a word). So, I replaced \w with [a-zA-Z0-9_] (there are probably characters covered by \w not covered by my replacement, but this captures all the test names we are currently using).

I also made changes to the sed command to make it a bit more readable (at least to me). This meant replacing \ with | as the delimeter of the sed command, and pasing the -r flag to use extended regular expressions (saving us from having to escape parentheses when using them to capture a group, for example).

I did read that -r works for gnu sed while -E is the command to use for macos sed, but both worked on both the ubuntu and the macos machines I tested on.