Skip to content

Commit

Permalink
Tutorial unit test (Failure check)
Browse files Browse the repository at this point in the history
  • Loading branch information
SabreML committed Feb 11, 2024
1 parent 38c03c9 commit a595b97
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 8 deletions.
8 changes: 4 additions & 4 deletions code/datums/tutorial/xenomorph/xenomorph_basic.dm
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#define WAITING_HEALTH_THRESHOLD 300

/datum/tutorial/xenomorph/basic
name = "Xenomorph - Basic"
desc = "A tutorial to get you acquainted with the very basics of how to play a xenomorph."
icon_state = "xeno"
tutorial_id = "xeno_basic_1"
//name = "Xenomorph - Basic"
//desc = "A tutorial to get you acquainted with the very basics of how to play a xenomorph."
//icon_state = "xeno"
//tutorial_id = "xeno_basic_1"
tutorial_template = /datum/map_template/tutorial/s12x12
starting_xenomorph_type = /mob/living/carbon/xenomorph/drone

Expand Down
12 changes: 8 additions & 4 deletions code/modules/unit_tests/_unit_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,19 +74,23 @@
/// A trait source when adding traits through unit tests
#define TRAIT_SOURCE_UNIT_TESTS "unit_tests"

// Unit tests
#include "autowiki.dm"
#include "check_runtimes.dm"
#include "create_and_destroy.dm"
#include "focus_only_tests.dm"
#include "emote_panels.dm"
#include "missing_icons.dm"
#include "resist.dm"
#include "spawn_humans.dm"
#include "spritesheets.dm"
#include "subsystem_init.dm"
#include "tgui_create_message.dm"
#include "timer_sanity.dm"
#include "tutorials.dm"

// Unit tests backend
#include "focus_only_tests.dm"
#include "unit_test.dm"
#include "spawn_humans.dm"
#include "check_runtimes.dm"
#include "emote_panels.dm"

#undef TEST_ASSERT
#undef TEST_ASSERT_EQUAL
Expand Down
19 changes: 19 additions & 0 deletions code/modules/unit_tests/tutorials.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
/datum/unit_test/tutorials

/datum/unit_test/tutorials/Run()
var/datum/tutorial/base_path = /datum/tutorial
for(var/datum/tutorial/tutorial_path as anything in subtypesof(base_path))
if(initial(tutorial_path.parent_path) == tutorial_path)
continue

// Make sure these variables are overridden on any subtypes.
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.name), initial(base_path.name),
"[tutorial_path] does not have a name set.")

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (chinook) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (new_varadero) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (runtime) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (whiskey_outpost_v2) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (desert_dam) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (fiorina_sciannex) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (ice_colony_v2) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (corsat) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (almayer) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (kutjevo) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (lv624) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (prison_station_fop) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (sorokyne_strata) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (lv522_chances_claim) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Alternate Tests (515, 1630, lv624) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (bigredv2) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.

Check failure on line 11 in code/modules/unit_tests/tutorials.dm

View workflow job for this annotation

GitHub Actions / Unit Tests (shivas_snowball) / run_unit_tests

/datum/map_config: /datum/unit_test/tutorials

Expected Base to not be equal to Base. /datum/tutorial/xenomorph/basic does not have a name set.
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.tutorial_id), initial(base_path.tutorial_id),
"[tutorial_path] does not have a tutorial_id set.")
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.desc), initial(base_path.desc),
"[tutorial_path] does not have a desc set.")
TEST_ASSERT_NOTEQUAL(initial(tutorial_path.icon_state), initial(base_path.icon_state),
"[tutorial_path] does not have an icon_state set.")

// TODO: Add a test verifying that a basic tutorial can be started and completed. (Requires unit test client handling)

0 comments on commit a595b97

Please sign in to comment.