| 
									
										
										
										
											2020-05-12 22:56:01 +02:00
										 |  |  | #!/bin/bash -e | 
					
						
							|  |  |  | # | 
					
						
							| 
									
										
										
										
											2021-01-01 23:10:28 -08:00
										 |  |  | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other | 
					
						
							| 
									
										
										
										
											2020-05-12 22:56:01 +02:00
										 |  |  | # Spack Project Developers. See the top-level COPYRIGHT file for details. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # SPDX-License-Identifier: (Apache-2.0 OR MIT) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # Description: | 
					
						
							|  |  |  | #     Runs Spack shell tests. | 
					
						
							|  |  |  | # | 
					
						
							|  |  |  | # Usage: | 
					
						
							|  |  |  | #     run-shell-tests | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #----------------------------------------------------------- | 
					
						
							|  |  |  | # Run a few initial commands and set up test environment | 
					
						
							|  |  |  | #----------------------------------------------------------- | 
					
						
							|  |  |  | ORIGINAL_PATH="$PATH" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | . "$(dirname $0)/setup.sh" | 
					
						
							| 
									
										
										
										
											2020-07-01 18:58:53 +02:00
										 |  |  | check_dependencies $coverage kcov git hg svn | 
					
						
							| 
									
										
										
										
											2020-05-12 22:56:01 +02:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Clean the environment by removing Spack from the path and getting rid of | 
					
						
							|  |  |  | # the spack shell function | 
					
						
							|  |  |  | export PATH="$ORIGINAL_PATH" | 
					
						
							|  |  |  | unset spack | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-30 12:26:27 -07:00
										 |  |  | # Convert QA_DIR to absolute path before changing directory | 
					
						
							|  |  |  | export QA_DIR=$(realpath $QA_DIR) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-05-12 22:56:01 +02:00
										 |  |  | # Start in the spack root directory | 
					
						
							|  |  |  | cd "$SPACK_ROOT" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Run bash tests with coverage enabled, but pipe output to /dev/null | 
					
						
							|  |  |  | # because it seems that kcov seems to undo the script's redirection | 
					
						
							|  |  |  | if [ "$COVERAGE" = true ]; then | 
					
						
							|  |  |  |     "$QA_DIR/bashcov" "$QA_DIR/setup-env-test.sh" &> /dev/null | 
					
						
							|  |  |  |     "$QA_DIR/bashcov" "$QA_DIR/completion-test.sh" &> /dev/null | 
					
						
							|  |  |  | else | 
					
						
							|  |  |  |     bash "$QA_DIR/setup-env-test.sh" | 
					
						
							|  |  |  |     bash "$QA_DIR/completion-test.sh" | 
					
						
							|  |  |  | fi | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | # Run the test scripts for their output (these will print nicely) | 
					
						
							|  |  |  | zsh  "$QA_DIR/setup-env-test.sh" | 
					
						
							| 
									
										
										
										
											2020-12-18 17:26:15 -08:00
										 |  |  | zsh "$QA_DIR/completion-test.sh" | 
					
						
							| 
									
										
										
										
											2020-05-12 22:56:01 +02:00
										 |  |  | dash "$QA_DIR/setup-env-test.sh" | 
					
						
							| 
									
										
										
										
											2020-06-30 12:26:27 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # Run fish tests | 
					
						
							|  |  |  | fish "$QA_DIR/setup-env-test.fish" | 
					
						
							| 
									
										
										
										
											2020-10-23 18:54:34 -07:00
										 |  |  | 
 | 
					
						
							|  |  |  | # run csh and tcsh tests | 
					
						
							|  |  |  | csh  "$QA_DIR/setup-env-test.csh" | 
					
						
							|  |  |  | tcsh "$QA_DIR/setup-env-test.csh" |