Parcourir la source

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

Scott Lahteine il y a 6 ans
Parent
révision
8c11220042
Aucun compte lié à l'adresse e-mail de l'auteur

+ 4
- 8
.circleci/config.yml Voir le fichier

@@ -51,13 +51,13 @@ jobs:
51 51
             export PATH=`pwd`/buildroot/bin/:${PATH}
52 52
 
53 53
             # Generate custom version include
54
-            generate_version_header_for_marlin ./Marlin/src/inc
54
+            generate_version ./Marlin/src/inc
55 55
             cat ./Marlin/src/inc/_Version.h
56
-
57 56
             #
58
-            # Back up the environment
57
+            # Backup pins_RAMPS.h
58
+            #
59
+            cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
59 60
             #
60
-            env_backup
61 61
 
62 62
             #################################
63 63
             # Build all sample configurations
@@ -279,10 +279,6 @@ jobs:
279 279
             # Remove temp files from dependencies tree prior to caching
280 280
             rm -rf ~/Marlin/.piolibdeps/_tmp_*
281 281
 
282
-            #
283
-            # Restore the environment
284
-            #
285
-            env_restore
286 282
 
287 283
 
288 284
       - save_cache:

+ 1
- 1
.travis.yml Voir le fichier

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

+ 2
- 2
buildroot/bin/env_backup Voir le fichier

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

+ 21
- 6
buildroot/bin/env_restore Voir le fichier

@@ -2,10 +2,25 @@
2 2
 
3 3
 [ -z "$1" ] || cd $1
4 4
 
5
-cp Marlin/src/config/default/* Marlin/
6
-[ -f Marlin/_Bootscreen.h ] && rm Marlin/_Bootscreen.h
7
-[ -f Marlin/_Statusscreen.h ] && rm Marlin/_Statusscreen.h
8
-[ -d .test/pins ] && { cp .test/pins/* Marlin/src/pins/ ; rm -rf .test/pins ; }
9
-[ -d .test ] && rm -r .test
5
+if [ -d ".test" ]; then
6
+  cp .test/Configuration*.h Marlin/
7
+  rm .test/Configuration*.h
10 8
 
11
-printf "\033[0;32mEnvironment Restored\033[0m\n"
9
+  if [ -f .test/_Bootscreen.h ]; then
10
+    cp .test/_Bootscreen.h Marlin/
11
+    rm .test/_Bootscreen.h
12
+  fi
13
+
14
+  if [ -f .test/_Statusscreen.h ]; then
15
+    cp .test/_Statusscreen.h Marlin/
16
+    rm .test/_Statusscreen.h
17
+  fi
18
+
19
+  cp -r .test/pins Marlin/src
20
+  rm -r .test/pins
21
+
22
+  rmdir .test
23
+  printf "\033[0;32mEnvironment Restored\033[0m\n"
24
+else
25
+  printf "\033[0;31mEnvironment Backup not available!\033[0m\n"
26
+fi

buildroot/bin/generate_version_header_for_marlin → buildroot/bin/generate_version Voir le fichier

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

+ 5
- 11
buildroot/bin/restore_configs Voir le fichier

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

+ 1
- 1
buildroot/bin/update_defaults Voir le fichier

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

+ 1
- 6
buildroot/share/tests/DUE_tests Voir le fichier

@@ -3,14 +3,9 @@
3 3
 # exit on first failure
4 4
 set -e
5 5
 
6
-env_backup
7
-
6
+restore_configs
8 7
 opt_set MOTHERBOARD BOARD_RAMPS4DUE_EFB
9
-update_defaults
10
-
11 8
 opt_enable S_CURVE_ACCELERATION EEPROM_SETTINGS
12 9
 opt_set E0_AUTO_FAN_PIN 8
13 10
 opt_set EXTRUDER_AUTO_FAN_SPEED 100
14 11
 exec_test $1 $2 "RAMPS4DUE_EFB S_CURVE_ACCELERATION EEPROM_SETTINGS"
15
-
16
-env_restore

+ 3
- 5
buildroot/share/tests/LPC1768_tests Voir le fichier

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

+ 3
- 5
buildroot/share/tests/STM32F1_tests Voir le fichier

@@ -3,12 +3,10 @@
3 3
 # exit on first failure
4 4
 set -e
5 5
 
6
-env_backup
7
-
6
+restore_configs
8 7
 opt_set MOTHERBOARD BOARD_STM32F1R
9
-update_defaults
10
-
11 8
 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
12 9
 exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT"
13 10
 
14
-env_restore
11
+#cleanup
12
+restore_configs

+ 7
- 4
buildroot/share/tests/megaatmega2560_tests Voir le fichier

@@ -3,13 +3,15 @@
3 3
 # exit on first failure
4 4
 set -e
5 5
 
6
-env_backup
7
-
6
+#
7
+# Backup pins_RAMPS.h
8
+#
9
+cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
8 10
 #
9 11
 # Build with the default configurations
10 12
 #
13
+restore_configs
11 14
 exec_test $1 $2 "Default Configuration"
12
-
13 15
 #
14 16
 # Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4
15 17
 # Test a "Fix Mounted" Probe with Safe Homing, some arc options,
@@ -309,4 +311,5 @@ exec_test $1 $2 "TMC2208 Config"
309 311
 #
310 312
 #
311 313
 
312
-env_restore
314
+#clean up
315
+restore_configs

+ 5
- 9
buildroot/share/tests/start_tests Voir le fichier

@@ -1,17 +1,11 @@
1 1
 #!/usr/bin/env bash
2
-#
3
-# start_tests
4
-#
5
-# Run one or more tests
6
-#
7
-
8 2
 export PATH="$PATH:$( cd "$(dirname "${BASH_SOURCE[0]}")" ; pwd -P )"
9 3
 export PATH="$PATH:./buildroot/bin"
10 4
 
11 5
 # exit on first failure
12 6
 set -e
13 7
 
14
-exec_test() {
8
+exec_test () {
15 9
   printf "\033[0;32m[Test $2] \033[0m$3... "
16 10
   if build_marlin_pio $1 "-e $2"; then
17 11
     printf "\033[0;32mPassed\033[0m\n"
@@ -24,6 +18,9 @@ exec_test() {
24 18
 }
25 19
 export -f exec_test
26 20
 
21
+env_backup
22
+printf "Running \033[0;32m$2\033[0m Tests\n"
23
+
27 24
 if [[ $3 = "--deep-clean" ]]; then
28 25
   echo "Deleting all PlatformIO caches, downloads and installed packages..."
29 26
   env_clean --deep
@@ -39,9 +36,8 @@ if [[ $2 = "ALL" ]]; then
39 36
     $f $1 $testenv
40 37
   done
41 38
 else
42
-  printf "Running \033[0;32m$2\033[0m Tests\n"
43 39
   exec_test $1 "$2 --target clean" "Setup Build Environment"
44 40
   $2_tests $1 $2
45 41
 fi
46
-
47 42
 printf "\033[0;32mAll tests completed successfully\033[0m\n"
43
+env_restore

+ 4
- 5
buildroot/share/tests/teensy35_tests Voir le fichier

@@ -3,11 +3,9 @@
3 3
 # exit on first failure
4 4
 set -e
5 5
 
6
-env_backup
7
-
6
+restore_configs
8 7
 opt_set MOTHERBOARD BOARD_TEENSY35_36
9
-update_defaults
10
-
8
+cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
11 9
 #
12 10
 # Test Teensy3.5 with default config
13 11
 #
@@ -94,4 +92,5 @@ opt_add_adv Z2_MAX_PIN 2
94 92
 opt_enable USE_XMAX_PLUG
95 93
 exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS"
96 94
 
97
-env_restore
95
+#cleanup
96
+restore_configs

Chargement…
Annuler
Enregistrer