Procházet zdrojové kódy

Update platform tests to use '.test' folder

Scott Lahteine před 6 roky
rodič
revize
05dc79e78d

+ 7
- 3
.circleci/config.yml Zobrazit soubor

53
             # Generate custom version include
53
             # Generate custom version include
54
             generate_version_header_for_marlin ./Marlin/src/inc
54
             generate_version_header_for_marlin ./Marlin/src/inc
55
             cat ./Marlin/src/inc/_Version.h
55
             cat ./Marlin/src/inc/_Version.h
56
+
56
             #
57
             #
57
-            # Backup pins_RAMPS.h
58
-            #
59
-            cp Marlin/src/pins/pins_RAMPS.h Marlin/src/pins/pins_RAMPS.h.backup
58
+            # Back up the environment
60
             #
59
             #
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
282
 
286
 
283
 
287
 
284
       - save_cache:
288
       - save_cache:

+ 2
- 2
buildroot/bin/env_backup Zobrazit soubor

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
9
   cp Marlin/Configuration*.h .test/
10
   cp Marlin/Configuration*.h .test/
10
   [ -f Marlin/_Bootscreen.h ] && cp Marlin/_Bootscreen.h .test/
11
   [ -f Marlin/_Bootscreen.h ] && cp Marlin/_Bootscreen.h .test/
11
   [ -f Marlin/_Statusscreen.h ] && cp Marlin/_Statusscreen.h .test/
12
   [ -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

+ 6
- 21
buildroot/bin/env_restore Zobrazit soubor

2
 
2
 
3
 [ -z "$1" ] || cd $1
3
 [ -z "$1" ] || cd $1
4
 
4
 
5
-if [ -d ".test" ]; then
6
-  cp .test/Configuration*.h Marlin/
7
-  rm .test/Configuration*.h
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
8
 
10
 
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
11
+printf "\033[0;32mEnvironment Restored\033[0m\n"

+ 11
- 13
buildroot/bin/restore_configs Zobrazit soubor

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
+#
2
 
7
 
3
-cp Marlin/src/config/default/Configuration.h     Marlin/Configuration.h
4
-cp Marlin/src/config/default/Configuration_adv.h Marlin/Configuration_adv.h
8
+# Restore the (possibly modified) Configurations
9
+[ -d ".test" -a -f ".test/Configuration.h" ] && cp .test/Configuration*.h Marlin/
5
 
10
 
6
-if [ -f Marlin/src/pins/pins_RAMPS.h.backup ]; then
7
-  cp Marlin/src/pins/pins_RAMPS.h.backup Marlin/src/pins/pins_RAMPS.h
8
-  rm Marlin/src/pins/pins_RAMPS.h.backup
9
-fi
11
+# Restore the original unmodified pins
12
+[ -d ".test/pins" ] && cp -r .test/pins Marlin/src/pins/
10
 
13
 
11
-if [ -f Marlin/_Bootscreen.h ]; then
12
-  rm Marlin/_Bootscreen.h
13
-fi
14
-
15
-if [ -f Marlin/_Statusscreen.h ]; then
16
-  rm Marlin/_Statusscreen.h
17
-fi
14
+# Delete DOGM bitmaps
15
+rm -f Marlin/_*screen.h

+ 1
- 2
buildroot/bin/update_defaults Zobrazit soubor

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

+ 6
- 1
buildroot/share/tests/DUE_tests Zobrazit soubor

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

+ 5
- 3
buildroot/share/tests/LPC1768_tests Zobrazit soubor

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

+ 5
- 3
buildroot/share/tests/STM32F1_tests Zobrazit soubor

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

+ 4
- 7
buildroot/share/tests/megaatmega2560_tests Zobrazit soubor

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

+ 9
- 5
buildroot/share/tests/start_tests Zobrazit soubor

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

+ 5
- 4
buildroot/share/tests/teensy35_tests Zobrazit soubor

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

Loading…
Zrušit
Uložit