• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

visgl / luma.gl / 17192022436

24 Aug 2025 06:02PM UTC coverage: 62.079% (-13.2%) from 75.234%
17192022436

Pull #2437

github

web-flow
Merge 562c391b0 into 8314ecefa
Pull Request #2437: test(engine): add ShaderPassRenderer test

956 of 1559 branches covered (61.32%)

Branch coverage included in aggregate %.

491 of 666 new or added lines in 7 files covered. (73.72%)

5291 existing lines in 117 files now uncovered.

23238 of 37414 relevant lines covered (62.11%)

3.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

40.63
/modules/shadertools/src/lib/preprocessor/preprocessor.ts
1
// luma.gl
1✔
2
// SPDX-License-Identifier: MIT
1✔
3
// Copyright (c) vis.gl contributors
1✔
4

1✔
5
const IFDEF_REGEXP = /^\s*\#\s*ifdef\s*([a-zA-Z_]+)\s*$/;
1✔
6
const ENDIF_REGEXP = /^\s*\#\s*endif\s*$/;
1✔
7

1✔
8
export type PreprocessorOptions = {
1✔
9
  defines?: Record<string, boolean>;
1✔
10
};
1✔
11

1✔
12
export function preprocess(source: string, options?: PreprocessorOptions): string {
1✔
UNCOV
13
  const lines = source.split('\n');
×
UNCOV
14
  const output: string[] = [];
×
UNCOV
15

×
UNCOV
16
  let conditional = true;
×
UNCOV
17
  let currentDefine: string | null = null;
×
UNCOV
18
  for (const line of lines) {
×
UNCOV
19
    const matchIf = line.match(IFDEF_REGEXP);
×
UNCOV
20
    const matchEnd = line.match(ENDIF_REGEXP);
×
UNCOV
21
    if (matchIf) {
×
UNCOV
22
      currentDefine = matchIf[1];
×
UNCOV
23
      conditional = Boolean(options?.defines?.[currentDefine]);
×
UNCOV
24
    } else if (matchEnd) {
×
UNCOV
25
      conditional = true;
×
UNCOV
26
    } else if (conditional) {
×
UNCOV
27
      output.push(line);
×
UNCOV
28
    }
×
UNCOV
29
  }
×
UNCOV
30
  return output.join('\n');
×
UNCOV
31
}
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc