diff --git a/build-scripts/build.sh b/build-scripts/build.sh index 64032fc23e956..77c64f95d0287 100755 --- a/build-scripts/build.sh +++ b/build-scripts/build.sh @@ -9,7 +9,11 @@ num_jobs=3 function run_tests { # --min-duration shows timing lines for tests with a duration of at least that many seconds. - $WINE "$@" --min-duration 0.2 --use-colour yes --rng-seed time $EXTRA_TEST_OPTS + $WINE "$@" --min-duration 0.2 --use-colour yes --rng-seed time $EXTRA_TEST_OPTS "crafting_skill_gain"& + $WINE "$@" --min-duration 0.2 --use-colour yes --rng-seed time $EXTRA_TEST_OPTS "[slow] !crafting_skill_gain"& + $WINE "$@" --min-duration 0.2 --use-colour yes --rng-seed time $EXTRA_TEST_OPTS "~[slow] ~[.]"& + wait -n + wait -n } # We might need binaries installed via pip, so ensure that our personal bin dir is on the PATH diff --git a/tests/Makefile b/tests/Makefile index 814ca437a9d3b..c5852f4b1dd20 100644 --- a/tests/Makefile +++ b/tests/Makefile @@ -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: @@ -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) diff --git a/tests/crafting_test.cpp b/tests/crafting_test.cpp index 24c88a8574544..bf8bc4b9e5788 100644 --- a/tests/crafting_test.cpp +++ b/tests/crafting_test.cpp @@ -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" ) {