MCPcopy Create free account
hub / github.com/FastLED/FastLED / generate_profiler

Method generate_profiler

ci/profile_runner.py:84–121  ·  view source on GitHub ↗

Generate profiler test with smart defaults (no interactive prompts)

(self)

Source from the content-addressed store, hash-verified

82 )
83
84 def generate_profiler(self) -> bool:
85 """Generate profiler test with smart defaults (no interactive prompts)"""
86 # Case 1: Profiler exists and we're not forcing regeneration
87 if self.test_path.exists() and not self.force_regenerate:
88 if self.skip_generate:
89 print(f"Using existing profiler: {self.test_path}")
90 else:
91 print(f"Using existing profiler: {self.test_path}")
92 print(" (Use --regenerate to recreate from template)")
93 return True
94
95 # Case 2: Profiler doesn't exist but generation is disabled
96 if not self.test_path.exists() and self.skip_generate:
97 print(f"❌ Profiler not found: {self.test_path}")
98 print(" Remove --no-generate flag to auto-generate, or create it manually")
99 return False
100
101 # Case 3: Generate profiler (either doesn't exist or --regenerate was used)
102 if self.force_regenerate:
103 print(f"Regenerating profiler for {self.target}...")
104 else:
105 print(f"Generating profiler for {self.target}...")
106
107 try:
108 subprocess.run(
109 [
110 "uv",
111 "run",
112 "python",
113 "ci/profile/generate_profile_test.py",
114 self.target,
115 ],
116 check=True,
117 )
118 return True
119 except subprocess.CalledProcessError as e:
120 print(f"Error generating profiler: {e}")
121 return False
122
123 def build_profiler(self) -> bool:
124 """Build profiler binary using test system (supports Docker)"""

Callers 1

runMethod · 0.95

Calls 2

printFunction · 0.50
runMethod · 0.45

Tested by

no test coverage detected