Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use #!/usr/bin/env bash #6

Closed
mcuee opened this issue Jan 17, 2024 · 2 comments · Fixed by #8
Closed

Use #!/usr/bin/env bash #6

mcuee opened this issue Jan 17, 2024 · 2 comments · Fixed by #8

Comments

@mcuee
Copy link

mcuee commented Jan 17, 2024

Reference from @askn37

We recommend that you do this.

#!/usr/bin/env bash

It looks for bash in your path and runs it, so it works regardless of your user environment. I've never seen a bintool without /usr/bin/env, so it shouldn't be a problem.

@askn37
Copy link

askn37 commented Jan 20, 2024

Additional suggestions. Hide extra dry run error messages that are not related to test suite progress. Next, reveal the name and version number of the avrdude executable.

diff --git a/avrdude_test_script.sh b/avrdude_test_script.sh
index b0906b5..e805e16 100755
--- a/avrdude_test_script.sh
+++ b/avrdude_test_script.sh
@@ -33,13 +33,15 @@ arraylength=${#pgm_and_target[@]}
   
     if [ "$key" == '' ]; then
       FAIL=false
+      echo "avrdude_bin=$avrdude_bin"
+      $avrdude_bin -Pusb -v 2>&1 | grep Version
   
       # Get flash and EEPROM size in bytes and make sure the numbers are in dec form
-      FLASH_SIZE=$($avrdude_bin $avrdude_conf ${pgm_and_target[$p]} -cdryrun -qq -T 'part -m' | grep flash | awk '{print $2}')
-      EE_SIZE=$($avrdude_bin $avrdude_conf ${pgm_and_target[$p]} -cdryrun -qq -T 'part -m' | grep eeprom | awk '{print $2}')
+      FLASH_SIZE=$($avrdude_bin $avrdude_conf ${pgm_and_target[$p]} -cdryrun -qq -T 'part -m' 2>/dev/null| grep flash | awk '{print $2}')
+      EE_SIZE=$($avrdude_bin $avrdude_conf ${pgm_and_target[$p]} -cdryrun -qq -T 'part -m' 2>/dev/null| grep eeprom | awk '{print $2}')
     
       # Memories that may or may not be present
-      USERSIG_SIZE=$($avrdude_bin $avrdude_conf ${pgm_and_target[$p]} -cdryrun -qq -T 'part -m' | grep usersig | awk '{print $2}') # R/W
+      USERSIG_SIZE=$($avrdude_bin $avrdude_conf ${pgm_and_target[$p]} -cdryrun -qq -T 'part -m' 2>/dev/null| grep usersig | awk '{print $2}') # R/W
 
       # Set, clear and read eesave fusebit
       sleep $delay

dryrun does not accept extended options, so pmsg_notice would probably be a better choice than pmsg_error, but that's another topic.

@stefanrueger
Copy link
Contributor

Neat ideas; see above PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants