Browse Source

[2.0.x] Debug Travis tests and scripts (#11704)

Scott Lahteine 6 years ago
parent
commit
8c11220042

+ 4 - 8
.circleci/config.yml

@@ -51,13 +51,13 @@ jobs:
             export PATH=`pwd`/buildroot/bin/:${PATH}
 
             # Generate custom version include
-            generate_version_header_for_marlin ./Marlin/src/inc
+            generate_version ./Marlin/src/inc
             cat ./Marlin/src/inc/_Version.h
-
             #
-            # Back up the environment
+            # Backup pins_RAMPS.h
+            #
+            cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
             #
-            env_backup
 
             #################################
             # Build all sample configurations
@@ -279,10 +279,6 @@ jobs:
             # Remove temp files from dependencies tree prior to caching
             rm -rf ~/Marlin/.piolibdeps/_tmp_*
 
-            #
-            # Restore the environment
-            #
-            env_restore
 
 
       - save_cache:

+ 1 - 1
.travis.yml

@@ -45,7 +45,7 @@ before_script:
   - cd ${TRAVIS_BUILD_DIR}
   #
   # Generate custom version include
-  - generate_version_header_for_marlin ${TRAVIS_BUILD_DIR}/Marlin/src/inc
+  - generate_version ${TRAVIS_BUILD_DIR}/Marlin/src/inc
   - cat ${TRAVIS_BUILD_DIR}/Marlin/src/inc/_Version.h
   #
 script:

+ 2 - 2
buildroot/bin/env_backup

@@ -2,13 +2,13 @@
 
 [ -z "$1" ] || cd $1
 
-if [ -d .test ]; then
+if [ -d ".test" ]; then
   printf "\033[0;31mEnvironment backup already exists!\033[0m\n"
 else
   mkdir .test
-  cp -r Marlin/src/pins .test/pins
   cp Marlin/Configuration*.h .test/
   [ -f Marlin/_Bootscreen.h ] && cp Marlin/_Bootscreen.h .test/
   [ -f Marlin/_Statusscreen.h ] && cp Marlin/_Statusscreen.h .test/
+  cp -r Marlin/src/pins .test/pins
   printf "\033[0;32mEnvironment Backup created\033[0m\n"
 fi

+ 21 - 6
buildroot/bin/env_restore

@@ -2,10 +2,25 @@
 
 [ -z "$1" ] || cd $1
 
-cp Marlin/src/config/default/* Marlin/
-[ -f Marlin/_Bootscreen.h ] && rm Marlin/_Bootscreen.h
-[ -f Marlin/_Statusscreen.h ] && rm Marlin/_Statusscreen.h
-[ -d .test/pins ] && { cp .test/pins/* Marlin/src/pins/ ; rm -rf .test/pins ; }
-[ -d .test ] && rm -r .test
+if [ -d ".test" ]; then
+  cp .test/Configuration*.h Marlin/
+  rm .test/Configuration*.h
 
-printf "\033[0;32mEnvironment Restored\033[0m\n"
+  if [ -f .test/_Bootscreen.h ]; then
+    cp .test/_Bootscreen.h Marlin/
+    rm .test/_Bootscreen.h
+  fi
+
+  if [ -f .test/_Statusscreen.h ]; then
+    cp .test/_Statusscreen.h Marlin/
+    rm .test/_Statusscreen.h
+  fi
+
+  cp -r .test/pins Marlin/src
+  rm -r .test/pins
+
+  rmdir .test
+  printf "\033[0;32mEnvironment Restored\033[0m\n"
+else
+  printf "\033[0;31mEnvironment Backup not available!\033[0m\n"
+fi

+ 7 - 8
buildroot/bin/generate_version_header_for_marlin → buildroot/bin/generate_version

@@ -1,5 +1,9 @@
 #!/usr/bin/env bash
-# generate_version_header_for_marlin
+#
+# generate_version
+#
+# Make a _Version.h file
+#
 
 DIR="${1}"
 
@@ -9,13 +13,8 @@ DISTDATE=$(date '+%Y-%m-%d %H:%M')
 BRANCH=$(git -C "${DIR}" symbolic-ref -q --short HEAD)
 VERSION=$(git -C "${DIR}" describe --tags --first-parent 2>/dev/null)
 
-if [ -z "${BRANCH}" ]; then
-  BRANCH=$(echo "${TRAVIS_BRANCH}")
-fi
-
-if [ -z "${VERSION}" ]; then
-  VERSION=$(git -C "${DIR}" describe --tags --first-parent --always 2>/dev/null)
-fi
+[ -z "${BRANCH}" ] && BRANCH=$(echo "${TRAVIS_BRANCH}")
+[ -z "${VERSION}" ] && VERSION=$(git -C "${DIR}" describe --tags --first-parent --always 2>/dev/null)
 
 SHORT_BUILD_VERSION=$(echo "${BRANCH}")
 DETAILED_BUILD_VERSION=$(echo "${BRANCH}-${VERSION}")

+ 5 - 11
buildroot/bin/restore_configs

@@ -1,15 +1,9 @@
 #!/usr/bin/env bash
-#
-# restore_configs
-#
-# Restore default configs, delete pins backup and dogm bitmaps
-#
 
-# Restore the (possibly modified) Configurations
-[ -d ".test" -a -f ".test/Configuration.h" ] && cp .test/Configuration*.h Marlin/
+cp Marlin/src/config/default/Configuration*.h Marlin
 
-# Restore the original unmodified pins
-[ -d ".test/pins" ] && cp -r .test/pins Marlin/src/pins/
+[ -f Marlin/src/pins/pins_RAMPS.h.backup ] && cp Marlin/src/pins/pins_RAMPS.h.backup Marlin/src/pins/pins_RAMPS.h
+rm -f Marlin/src/pins/pins_RAMPS.h.backup
 
-# Delete DOGM bitmaps
-rm -f Marlin/_*screen.h
+rm -f Marlin/_Bootscreen.h
+rm -f Marlin/_Statusscreen.h

+ 1 - 1
buildroot/bin/update_defaults

@@ -1,3 +1,3 @@
 #!/usr/bin/env bash
 
-cp Marlin/Configuration*.h .test/
+cp Marlin/Configuration*.h Marlin/src/config/default

+ 1 - 6
buildroot/share/tests/DUE_tests

@@ -3,14 +3,9 @@
 # exit on first failure
 set -e
 
-env_backup
-
+restore_configs
 opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB
-update_defaults
-
 opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS
 opt_set E0_AUTO_FAN_PIN 8
 opt_set EXTRUDER_AUTO_FAN_SPEED 100
 exec_test $1 $2 "RAMPS4DUE_EFB S_CURVE_ACCELERATION EEPROM_SETTINGS"
-
-env_restore

+ 3 - 5
buildroot/share/tests/LPC1768_tests

@@ -3,11 +3,8 @@
 # exit on first failure
 set -e
 
-env_backup
-
+restore_configs
 opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB
-update_defaults
-
 exec_test $1 $2 "Build Re-ARM Default Configuration"
 
 restore_configs
@@ -63,4 +60,5 @@ opt_enable FAN_SOFT_PWM SDSUPPORT
 opt_enable USE_XMAX_PLUG
 exec_test $1 $2 "MKS SBASE Many less common options"
 
-env_restore
+#clean up
+restore_configs

+ 3 - 5
buildroot/share/tests/STM32F1_tests

@@ -3,12 +3,10 @@
 # exit on first failure
 set -e
 
-env_backup
-
+restore_configs
 opt_set MOTHERBOARD BOARD_STM32F1R
-update_defaults
-
 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
 exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT"
 
-env_restore
+#cleanup
+restore_configs

Some files were not shown because too many files changed in this diff