Skip to content

Commit fb2c854

Browse files
committed
feat: add inheritance test cases and update Makefile to include them
1 parent 19d5ae7 commit fb2c854

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

Makefile

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,4 +176,15 @@ test_classes_w_jlox: build
176176
]" \
177177
$(shell pwd)/dist/main.out
178178

179-
test_all: test_scanning_w_jlox test_parsing_w_jlox test_evaluation_w_jlox test_statements_w_jlox test_control_flow_w_jlox test_functions_w_jlox test_resolving_w_jlox test_classes_w_jlox
179+
test_inheritance_w_jlox: build
180+
CODECRAFTERS_REPOSITORY_DIR=./craftinginterpreters/build/gen/chap13_inheritance \
181+
CODECRAFTERS_TEST_CASES_JSON="[ \
182+
{\"slug\":\"i1\",\"tester_log_prefix\":\"stage_901\",\"title\":\"Stage #901: Inheritance: Class Hierarchy\"}, \
183+
{\"slug\":\"i2\",\"tester_log_prefix\":\"stage_902\",\"title\":\"Stage #902: Inheritance: Inheriting methods\"}, \
184+
{\"slug\":\"i3\",\"tester_log_prefix\":\"stage_903\",\"title\":\"Stage #903: Inheritance: Superclass method calls\"}, \
185+
{\"slug\":\"i4\",\"tester_log_prefix\":\"stage_904\",\"title\":\"Stage #904: Inheritance: Invalid super usages\"}, \
186+
{\"slug\":\"i5\",\"tester_log_prefix\":\"stage_905\",\"title\":\"Stage #905: Inheritance: Misc\"} \
187+
]" \
188+
$(shell pwd)/dist/main.out
189+
190+
test_all: test_scanning_w_jlox test_parsing_w_jlox test_evaluation_w_jlox test_statements_w_jlox test_control_flow_w_jlox test_functions_w_jlox test_resolving_w_jlox test_classes_w_jlox test_inheritance_w_jlox

internal/tester_definition.go

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,5 +321,25 @@ var testerDefinition = tester_definition.TesterDefinition{
321321
Slug: "eb9",
322322
TestFunc: createTestForRunCommandStage("cl8"),
323323
},
324+
{
325+
Slug: "i1",
326+
TestFunc: createTestForRunCommandStage("i1"),
327+
},
328+
{
329+
Slug: "i2",
330+
TestFunc: createTestForRunCommandStage("i2"),
331+
},
332+
{
333+
Slug: "i3",
334+
TestFunc: createTestForRunCommandStage("i3"),
335+
},
336+
{
337+
Slug: "i4",
338+
TestFunc: createTestForRunCommandStage("i4"),
339+
},
340+
{
341+
Slug: "i5",
342+
TestFunc: createTestForRunCommandStage("i5"),
343+
},
324344
},
325345
}

0 commit comments

Comments
 (0)