feat: coverage+perf for run
This commit is contained in:
30
run
30
run
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
# Build and run Gaze application
|
# Build and run Gaze application
|
||||||
# Usage: ./run [build|test|run|lsp] [-v|--verbose] [-o|--output <file>] [--no-lsp]
|
# Usage: ./run [build|test|run|lsp] [-v|--verbose] [-c|--coverage] [-p|--performance] [-o|--output <file>] [--no-lsp]
|
||||||
# Note: Default action (./run with no args) runs the app with verbose logging enabled
|
# Note: Default action (./run with no args) runs the app with verbose logging enabled
|
||||||
|
|
||||||
set -o pipefail
|
set -o pipefail
|
||||||
@@ -14,11 +14,25 @@ readonly APP_SUBSYSTEM="com.mikefreno.Gaze"
|
|||||||
VERBOSE=false
|
VERBOSE=false
|
||||||
OUTPUT_FILE=""
|
OUTPUT_FILE=""
|
||||||
SKIP_LSP=false
|
SKIP_LSP=false
|
||||||
|
PERFORMANCE=false
|
||||||
|
COVERAGE=false
|
||||||
|
|
||||||
# Constructs xcodebuild command with common parameters
|
# Constructs xcodebuild command with common parameters
|
||||||
build_xcodebuild_command() {
|
build_xcodebuild_command() {
|
||||||
local action="$1"
|
local action="$1"
|
||||||
echo "xcodebuild -project $PROJECT -scheme $SCHEME -configuration $CONFIGURATION $action"
|
local cmd="xcodebuild -project $PROJECT -scheme $SCHEME -configuration $CONFIGURATION $action"
|
||||||
|
|
||||||
|
# Add performance profiling if requested
|
||||||
|
if [ "$PERFORMANCE" = true ]; then
|
||||||
|
cmd="$cmd -enablePerformanceTestsDiagnostics YES"
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Add coverage analysis if requested
|
||||||
|
if [ "$COVERAGE" = true ]; then
|
||||||
|
cmd="$cmd -enableCodeCoverage YES"
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "$cmd"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Kills any existing Gaze processes
|
# Kills any existing Gaze processes
|
||||||
@@ -152,7 +166,7 @@ run_with_output() {
|
|||||||
|
|
||||||
# Displays usage information
|
# Displays usage information
|
||||||
show_usage() {
|
show_usage() {
|
||||||
echo "Usage: $0 [build|test|run|lsp] [-v|--verbose] [-o|--output <file_name>] [--no-lsp]"
|
echo "Usage: $0 [build|test|run|lsp] [-v|--verbose] [-o|--output <file_name>] [--no-lsp] [-p|--performance] [-c|--coverage]"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Commands:"
|
echo "Commands:"
|
||||||
echo " build - Build the application"
|
echo " build - Build the application"
|
||||||
@@ -164,6 +178,8 @@ show_usage() {
|
|||||||
echo " -v, --verbose - Show output in stdout"
|
echo " -v, --verbose - Show output in stdout"
|
||||||
echo " -o, --output - Write output to log file"
|
echo " -o, --output - Write output to log file"
|
||||||
echo " --no-lsp - Skip LSP configuration update"
|
echo " --no-lsp - Skip LSP configuration update"
|
||||||
|
echo " -p, --performance - Run tests with performance profiling"
|
||||||
|
echo " -c, --coverage - Run tests with code coverage analysis"
|
||||||
echo ""
|
echo ""
|
||||||
echo "Note: Running './run' with no arguments defaults to 'run' action with verbose logging."
|
echo "Note: Running './run' with no arguments defaults to 'run' action with verbose logging."
|
||||||
echo " Press Ctrl+C to stop log capture and keep the app running."
|
echo " Press Ctrl+C to stop log capture and keep the app running."
|
||||||
@@ -186,6 +202,14 @@ while [[ $# -gt 0 ]]; do
|
|||||||
SKIP_LSP=true
|
SKIP_LSP=true
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-p|--performance)
|
||||||
|
PERFORMANCE=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-c|--coverage)
|
||||||
|
COVERAGE=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -z "$ACTION" ]; then
|
if [ -z "$ACTION" ]; then
|
||||||
ACTION="$1"
|
ACTION="$1"
|
||||||
|
|||||||
Reference in New Issue
Block a user