Skip to content

Commit

Permalink
Batch test executons by default
Browse files Browse the repository at this point in the history
Improves build speed when invoked with parallellism.
  • Loading branch information
kevingranade committed Jan 22, 2021
1 parent 2537743 commit 2b2a3e9
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions tests/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,14 @@ $(TEST_TARGET): $(OBJS) $(CATA_LIB)
$(PCH_P): $(PCH_H)
-$(CXX) $(CPPFLAGS) $(DEFINES) $(subst -Werror,,$(CXXFLAGS)) -Wno-non-virtual-dtor -Wno-unused-macros -I. -c $(PCH_H) -o $(PCH_P)

# Iterate over all the individual tests.
check: $(TEST_TARGET)
TEST_BATCHES = "crafting_skill_gain" "[slow]\ ~crafting_skill_gain" "~[slow]\ ~[.]"

$(TEST_BATCHES): $(TEST_TARGET)
cd .. && tests/$(TEST_TARGET) --min-duration 0.2 --rng-seed time $@

check: $(TEST_TARGET) $(TEST_BATCHES)

check-single: $(TEST_TARGET)
cd .. && tests/$(TEST_TARGET) --min-duration 0.2 --rng-seed time

clean:
Expand All @@ -77,7 +83,7 @@ $(shell mkdir -p $(ODIR))
$(ODIR)/%.o: %.cpp $(PCH_P)
$(CXX) $(CPPFLAGS) $(DEFINES) $(CXXFLAGS) $(subst main-pch,tests-pch,$(PCHFLAGS)) -c ../tests/$< -o $@

.PHONY: clean check tests precompile_header
.PHONY: clean check check-single tests precompile_header

.SECONDARY: $(OBJS)

Expand Down
2 changes: 1 addition & 1 deletion tests/crafting_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -734,7 +734,7 @@ static void test_skill_progression( const recipe_id &test_recipe, int expected_t
CHECK( actual_turns_taken == expected_turns_taken );
}

TEST_CASE( "crafting skill gain" )
TEST_CASE( "crafting_skill_gain", "[skill],[crafting],[slow]" )
{
SECTION( "lvl 0 -> 1" ) {
GIVEN( "nominal morale" ) {
Expand Down

0 comments on commit 2b2a3e9

Please sign in to comment.