File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -16,11 +16,14 @@ pub fn build(b: *STD.Build) !void {
1616
1717 // cli
1818 {
19- const CPPLINGS_CLI = b .addExecutable (.{ .name = "cpplings_cli" , .root_module = b .createModule (.{
20- .target = TARGET ,
21- .optimize = OPTIMIZE ,
22- .root_source_file = b .path ("src/main.zig" ),
23- }) });
19+ const CPPLINGS_CLI = b .addExecutable (.{
20+ .name = "cpplings_cli" ,
21+ .root_module = b .createModule (.{
22+ .target = TARGET ,
23+ .optimize = OPTIMIZE ,
24+ .root_source_file = b .path ("src/main.zig" ),
25+ }),
26+ });
2427
2528 b .installArtifact (CPPLINGS_CLI );
2629 const CPPLINGS_CLI_ARTIFIACT = b .addRunArtifact (CPPLINGS_CLI );
@@ -36,6 +39,23 @@ pub fn build(b: *STD.Build) !void {
3639 }
3740 }
3841
42+ // tests
43+ {
44+ const CPPLINGS_CLI_TESTS = b .addTest (.{
45+ .name = "cpplings_tests" ,
46+ .root_module = b .createModule (.{
47+ .target = TARGET ,
48+ .optimize = OPTIMIZE ,
49+ .root_source_file = b .path ("src/test.zig" ),
50+ }),
51+ });
52+
53+ const CPPLINGS_CLI_TESTS_ARTIFACT = b .addRunArtifact (CPPLINGS_CLI_TESTS );
54+
55+ const CPPLINGS_CLI_TESTS_STEP = b .step ("tests" , "Run cpplings tests" );
56+ CPPLINGS_CLI_TESTS_STEP .dependOn (& CPPLINGS_CLI_TESTS_ARTIFACT .step );
57+ }
58+
3959 // exercises
4060 {
4161 const COMPILER_FLAGS = [_ ][]const u8 { "-std=c++23" , "-Wall" , "-Werror" , "-Wextra" };
Original file line number Diff line number Diff line change 11const STD = @import ("std" );
22
3- const CLI = @import ("cli.zig" );
4- const PATCH = @import ("patch.zig" );
5- const UTIL = @import ("util.zig" );
6-
73test "run all tests" {
84 STD .testing .refAllDecls (@This ());
5+
6+ comptime {
7+ _ = @import ("cli.zig" );
8+ _ = @import ("patch.zig" );
9+ _ = @import ("util.zig" );
10+ }
911}
You can’t perform that action at this time.
0 commit comments