Pārlūkot izejas kodu

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

Scott Lahteine 6 gadus atpakaļ
vecāks
revīzija
8c11220042
Revīzijas autora e-pasta adrese nav piesaistīta nevienam kontam

+ 4
- 8
.circleci/config.yml Parādīt failu

51
             export PATH=`pwd`/buildroot/bin/:${PATH}
51
             export PATH=`pwd`/buildroot/bin/:${PATH}
52
 
52
 
53
             # Generate custom version include
53
             # Generate custom version include
54
-            generate_version_header_for_marlin ./Marlin/src/inc
54
+            generate_version ./Marlin/src/inc
55
             cat ./Marlin/src/inc/_Version.h
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
             # Build all sample configurations
63
             # Build all sample configurations
279
             # Remove temp files from dependencies tree prior to caching
279
             # Remove temp files from dependencies tree prior to caching
280
             rm -rf ~/Marlin/.piolibdeps/_tmp_*
280
             rm -rf ~/Marlin/.piolibdeps/_tmp_*
281
 
281
 
282
-            #
283
-            # Restore the environment
284
-            #
285
-            env_restore
286
 
282
 
287
 
283
 
288
       - save_cache:
284
       - save_cache:

+ 1
- 1
.travis.yml Parādīt failu

45
   - cd ${TRAVIS_BUILD_DIR}
45
   - cd ${TRAVIS_BUILD_DIR}
46
   #
46
   #
47
   # Generate custom version include
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
   - cat ${TRAVIS_BUILD_DIR}/Marlin/src/inc/_Version.h
49
   - cat ${TRAVIS_BUILD_DIR}/Marlin/src/inc/_Version.h
50
   #
50
   #
51
 script:
51
 script:

+ 2
- 2
buildroot/bin/env_backup Parādīt failu

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

+ 21
- 6
buildroot/bin/env_restore Parādīt failu

2
 
2
 
3
 [ -z "$1" ] || cd $1
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 Parādīt failu

1
 #!/usr/bin/env bash
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
 DIR="${1}"
8
 DIR="${1}"
5
 
9
 
9
 BRANCH=$(git -C "${DIR}" symbolic-ref -q --short HEAD)
13
 BRANCH=$(git -C "${DIR}" symbolic-ref -q --short HEAD)
10
 VERSION=$(git -C "${DIR}" describe --tags --first-parent 2>/dev/null)
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
 SHORT_BUILD_VERSION=$(echo "${BRANCH}")
19
 SHORT_BUILD_VERSION=$(echo "${BRANCH}")
21
 DETAILED_BUILD_VERSION=$(echo "${BRANCH}-${VERSION}")
20
 DETAILED_BUILD_VERSION=$(echo "${BRANCH}-${VERSION}")

+ 5
- 11
buildroot/bin/restore_configs Parādīt failu

1
 #!/usr/bin/env bash
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 Parādīt failu

1
 #!/usr/bin/env bash
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 Parādīt failu

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

+ 3
- 5
buildroot/share/tests/LPC1768_tests Parādīt failu

3
 # exit on first failure
3
 # exit on first failure
4
 set -e
4
 set -e
5
 
5
 
6
-env_backup
7
-
6
+restore_configs
8
 opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB
7
 opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB
9
-update_defaults
10
-
11
 exec_test $1 $2 "Build Re-ARM Default Configuration"
8
 exec_test $1 $2 "Build Re-ARM Default Configuration"
12
 
9
 
13
 restore_configs
10
 restore_configs
63
 opt_enable USE_XMAX_PLUG
60
 opt_enable USE_XMAX_PLUG
64
 exec_test $1 $2 "MKS SBASE Many less common options"
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 Parādīt failu

3
 # exit on first failure
3
 # exit on first failure
4
 set -e
4
 set -e
5
 
5
 
6
-env_backup
7
-
6
+restore_configs
8
 opt_set MOTHERBOARD BOARD_STM32F1R
7
 opt_set MOTHERBOARD BOARD_STM32F1R
9
-update_defaults
10
-
11
 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
8
 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
12
 exec_test $1 $2 "STM32F1R EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT"
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 Parādīt failu

3
 # exit on first failure
3
 # exit on first failure
4
 set -e
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
 # Build with the default configurations
11
 # Build with the default configurations
10
 #
12
 #
13
+restore_configs
11
 exec_test $1 $2 "Default Configuration"
14
 exec_test $1 $2 "Default Configuration"
12
-
13
 #
15
 #
14
 # Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4
16
 # Test 2 extruders (one MAX6675) and heated bed on basic RAMPS 1.4
15
 # Test a "Fix Mounted" Probe with Safe Homing, some arc options,
17
 # Test a "Fix Mounted" Probe with Safe Homing, some arc options,
309
 #
311
 #
310
 #
312
 #
311
 
313
 
312
-env_restore
314
+#clean up
315
+restore_configs

+ 5
- 9
buildroot/share/tests/start_tests Parādīt failu

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

+ 4
- 5
buildroot/share/tests/teensy35_tests Parādīt failu

3
 # exit on first failure
3
 # exit on first failure
4
 set -e
4
 set -e
5
 
5
 
6
-env_backup
7
-
6
+restore_configs
8
 opt_set MOTHERBOARD BOARD_TEENSY35_36
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
 # Test Teensy3.5 with default config
10
 # Test Teensy3.5 with default config
13
 #
11
 #
94
 opt_enable USE_XMAX_PLUG
92
 opt_enable USE_XMAX_PLUG
95
 exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS"
93
 exec_test $1 $2 "Z_DUAL_STEPPER_DRIVERS, Z_DUAL_ENDSTOPS"
96
 
94
 
97
-env_restore
95
+#cleanup
96
+restore_configs

Notiek ielāde…
Atcelt
Saglabāt