-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathlib.zig
More file actions
231 lines (201 loc) · 8.36 KB
/
lib.zig
File metadata and controls
231 lines (201 loc) · 8.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
const std = @import("std");
// Core modules
pub const assertions = @import("assertions.zig");
pub const suite = @import("suite.zig");
pub const test_runner = @import("test_runner.zig");
pub const reporter = @import("reporter.zig");
pub const matchers = @import("matchers.zig");
pub const mock = @import("mock.zig");
pub const cli = @import("cli.zig");
pub const discovery = @import("discovery.zig");
pub const test_loader = @import("test_loader.zig");
pub const coverage = @import("coverage.zig");
pub const parallel = @import("parallel.zig");
pub const ui_server = @import("ui_server.zig");
pub const test_history = @import("test_history.zig");
pub const snapshot = @import("snapshot.zig");
pub const watch = @import("watch.zig");
pub const memory_profiler = @import("memory_profiler.zig");
pub const config = @import("config.zig");
pub const async_support = @import("async_support.zig");
pub const async_test = @import("async_test.zig");
pub const timeout = @import("timeout.zig");
pub const progress = @import("progress.zig");
pub const time = @import("time.zig");
pub const compat = @import("compat.zig");
// Re-export commonly used types and functions
pub const expect = assertions.expect;
pub const Expectation = assertions.Expectation;
pub const StringExpectation = assertions.StringExpectation;
pub const SliceExpectation = assertions.SliceExpectation;
pub const AssertionError = assertions.AssertionError;
// Suite management
pub const describe = suite.describe;
pub const it = suite.it;
pub const test_ = suite.test_;
pub const beforeEach = suite.beforeEach;
pub const afterEach = suite.afterEach;
pub const beforeAll = suite.beforeAll;
pub const afterAll = suite.afterAll;
pub const describeSkip = suite.describeSkip;
pub const describeOnly = suite.describeOnly;
pub const itSkip = suite.itSkip;
pub const itOnly = suite.itOnly;
// Async test management
pub const itAsync = suite.itAsync;
pub const itAsyncTimeout = suite.itAsyncTimeout;
pub const itAsyncSkip = suite.itAsyncSkip;
pub const itAsyncOnly = suite.itAsyncOnly;
// Timeout management
pub const itTimeout = suite.itTimeout;
pub const describeTimeout = suite.describeTimeout;
pub const TestSuite = suite.TestSuite;
pub const TestCase = suite.TestCase;
pub const TestStatus = suite.TestStatus;
pub const TestRegistry = suite.TestRegistry;
pub const TestFn = suite.TestFn;
pub const HookFn = suite.HookFn;
// Test runner
pub const TestRunner = test_runner.TestRunner;
pub const RunnerOptions = test_runner.RunnerOptions;
pub const ReporterType = test_runner.ReporterType;
pub const runTests = test_runner.runTests;
pub const runTestsWithOptions = test_runner.runTestsWithOptions;
// Reporters
pub const Reporter = reporter.Reporter;
pub const TestResults = reporter.TestResults;
pub const SpecReporter = reporter.SpecReporter;
pub const DotReporter = reporter.DotReporter;
pub const JsonReporter = reporter.JsonReporter;
pub const TAPReporter = reporter.TAPReporter;
pub const JUnitReporter = reporter.JUnitReporter;
pub const Colors = reporter.Colors;
// Matchers
pub const Matchers = matchers.Matchers;
pub const StructMatcher = matchers.StructMatcher;
pub const ArrayMatcher = matchers.ArrayMatcher;
pub const expectStruct = matchers.expectStruct;
pub const expectArray = matchers.expectArray;
pub const toBeCloseTo = matchers.Matchers.toBeCloseTo;
pub const toBeNaN = matchers.Matchers.toBeNaN;
pub const toBeInfinite = matchers.Matchers.toBeInfinite;
// Mocking
pub const Mock = mock.Mock;
pub const Spy = mock.Spy;
pub const createMock = mock.createMock;
pub const createSpy = mock.createSpy;
pub const CallRecord = mock.CallRecord;
// CLI
pub const CLI = cli.CLI;
pub const CLIOptions = cli.CLIOptions;
// Test Discovery
pub const DiscoveryOptions = discovery.DiscoveryOptions;
pub const DiscoveryResult = discovery.DiscoveryResult;
pub const TestFile = discovery.TestFile;
pub const discoverTests = discovery.discoverTests;
// Test Loader
pub const LoaderOptions = test_loader.LoaderOptions;
pub const runDiscoveredTests = test_loader.runDiscoveredTests;
// Coverage
pub const CoverageOptions = coverage.CoverageOptions;
pub const CoverageResult = coverage.CoverageResult;
pub const CoverageTool = coverage.CoverageTool;
pub const runWithCoverage = coverage.runWithCoverage;
pub const runTestWithCoverage = coverage.runTestWithCoverage;
pub const parseCoverageReport = coverage.parseCoverageReport;
pub const printCoverageSummary = coverage.printCoverageSummary;
pub const isCoverageToolAvailable = coverage.isCoverageToolAvailable;
// Parallel Execution
pub const ParallelOptions = parallel.ParallelOptions;
pub const runTestsParallel = parallel.runTestsParallel;
// UI Server
pub const UIServer = ui_server.UIServer;
pub const UIServerOptions = ui_server.UIServerOptions;
pub const UIReporter = ui_server.UIReporter;
pub const MultiReporter = ui_server.MultiReporter;
// Test History
pub const TestHistory = test_history.TestHistory;
pub const HistoryEntry = test_history.HistoryEntry;
pub const TestRecord = test_history.TestRecord;
// Snapshot Testing
pub const Snapshot = snapshot.Snapshot;
pub const SnapshotOptions = snapshot.SnapshotOptions;
pub const SnapshotFormat = snapshot.SnapshotFormat;
pub const SnapshotDiff = snapshot.SnapshotDiff;
pub const DiffEntry = snapshot.DiffEntry;
pub const InlineSnapshot = snapshot.InlineSnapshot;
pub const SnapshotCleanup = snapshot.SnapshotCleanup;
pub const createSnapshot = snapshot.snapshot;
// Watch Mode
pub const TestWatcher = watch.TestWatcher;
pub const WatchOptions = watch.WatchOptions;
pub const FileWatcher = watch.FileWatcher;
// Memory Profiling
pub const MemoryProfiler = memory_profiler.MemoryProfiler;
pub const MemoryStats = memory_profiler.MemoryStats;
pub const ProfilingAllocator = memory_profiler.ProfilingAllocator;
pub const ProfileOptions = memory_profiler.ProfileOptions;
// Configuration
pub const TestConfig = config.TestConfig;
pub const ConfigLoader = config.ConfigLoader;
pub const ConfigFormat = config.ConfigFormat;
// Async Support
pub const Future = async_support.Future;
pub const Promise = async_support.Promise;
pub const AsyncExecutor = async_support.AsyncExecutor;
pub const runAsync = async_support.runAsync;
pub const asyncDelay = async_support.delay;
// Async Test Support
pub const AsyncTestExecutor = async_test.AsyncTestExecutor;
pub const AsyncTestContext = async_test.AsyncTestContext;
pub const AsyncTestResult = async_test.AsyncTestResult;
pub const AsyncHooksManager = async_test.AsyncHooksManager;
pub const AsyncOptions = async_test.AsyncOptions;
pub const AsyncStatus = async_test.AsyncStatus;
pub const AsyncStats = async_test.AsyncStats;
// Timeout Support
pub const TimeoutContext = timeout.TimeoutContext;
pub const TimeoutEnforcer = timeout.TimeoutEnforcer;
pub const TimeoutConfig = timeout.TimeoutConfig;
pub const GlobalTimeoutConfig = timeout.GlobalTimeoutConfig;
pub const TimeoutStatus = timeout.TimeoutStatus;
pub const TimeoutResult = timeout.TimeoutResult;
pub const SuiteTimeoutTracker = timeout.SuiteTimeoutTracker;
// Progress Indicators
pub const Spinner = progress.Spinner;
pub const SpinnerStyle = progress.SpinnerStyle;
pub const ProgressBar = progress.ProgressBar;
pub const ProgressBarStyle = progress.ProgressBarStyle;
pub const TestProgress = progress.TestProgress;
pub const MultiSpinner = progress.MultiSpinner;
// Time Mocking
pub const TimeMock = time.TimeMock;
pub const DateHelper = time.DateHelper;
pub const setSystemTime = time.setSystemTime;
pub const useFakeTimers = time.useFakeTimers;
pub const useRealTimers = time.useRealTimers;
pub const advanceTimersByTime = time.advanceTimersByTime;
pub const createDateHelper = time.createDateHelper;
pub const cleanupTimeMock = time.cleanupTimeMock;
// Jest-compatible time functions
pub const jest = struct {
pub const setSystemTime = time.jest.setSystemTime;
pub const useFakeTimers = time.jest.useFakeTimers;
pub const useRealTimers = time.jest.useRealTimers;
pub const now = time.jest.now;
pub const advanceTimersByTime = time.jest.advanceTimersByTime;
pub const clearAllTimers = time.jest.clearAllTimers;
pub const runAllTimers = time.jest.runAllTimers;
pub const runOnlyPendingTimers = time.jest.runOnlyPendingTimers;
};
// Utility to get the test registry
pub fn getRegistry(allocator: std.mem.Allocator) *TestRegistry {
return suite.getRegistry(allocator);
}
// Utility to clean up the test registry
pub fn cleanupRegistry() void {
suite.cleanupRegistry();
}
test "import all modules" {
std.testing.refAllDecls(@This());
}