Преглед изворни кода

Update platform tests to use '.test' folder

Scott Lahteine пре 6 година
родитељ
комит
05dc79e78d

+ 7
- 3
.circleci/config.yml Прегледај датотеку

@@ -53,11 +53,11 @@ jobs:
53 53
             # Generate custom version include
54 54
             generate_version_header_for_marlin ./Marlin/src/inc
55 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 63
             # Build all sample configurations
@@ -279,6 +279,10 @@ 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
282 286
 
283 287
 
284 288
       - save_cache:

+ 2
- 2
buildroot/bin/env_backup Прегледај датотеку

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

+ 6
- 21
buildroot/bin/env_restore Прегледај датотеку

@@ -2,25 +2,10 @@
2 2
 
3 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 Прегледај датотеку

@@ -1,17 +1,15 @@
1 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 Прегледај датотеку

@@ -1,4 +1,3 @@
1 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 Прегледај датотеку

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

+ 5
- 3
buildroot/share/tests/LPC1768_tests Прегледај датотеку

@@ -3,8 +3,11 @@
3 3
 # exit on first failure
4 4
 set -e
5 5
 
6
-restore_configs
6
+env_backup
7
+
7 8
 opt_set MOTHERBOARD BOARD_RAMPS_14_RE_ARM_EFB
9
+update_defaults
10
+
8 11
 exec_test $1 $2 "Build Re-ARM Default Configuration"
9 12
 
10 13
 restore_configs
@@ -60,5 +63,4 @@ opt_enable FAN_SOFT_PWM SDSUPPORT
60 63
 opt_enable USE_XMAX_PLUG
61 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 Прегледај датотеку

@@ -3,10 +3,12 @@
3 3
 # exit on first failure
4 4
 set -e
5 5
 
6
-restore_configs
6
+env_backup
7
+
7 8
 opt_set MOTHERBOARD BOARD_STM32F1R
9
+update_defaults
10
+
8 11
 opt_enable EEPROM_SETTINGS EEPROM_CHITCHAT REPRAP_DISCOUNT_SMART_CONTROLLER SDSUPPORT
9 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 Прегледај датотеку

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

+ 9
- 5
buildroot/share/tests/start_tests Прегледај датотеку

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

+ 5
- 4
buildroot/share/tests/teensy35_tests Прегледај датотеку

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

Loading…
Откажи
Сачувај