Added build.
This commit is contained in:
23
.github/workflows/build.yml
vendored
Normal file
23
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
name: build
|
||||
on:
|
||||
pull_request:
|
||||
branches: [ master ]
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout 🛎️
|
||||
uses: actions/checkout@v2.3.1
|
||||
|
||||
- name: Setup cmake
|
||||
uses: jwlawson/actions-setup-cmake@v1.9
|
||||
with:
|
||||
cmake-version: '3.13.x'
|
||||
|
||||
- name: Get Libraries
|
||||
run: git submodule update --init --recursive
|
||||
|
||||
- name: Build
|
||||
run: |
|
||||
cmake -B build
|
||||
cmake --build ./build
|
@ -14,14 +14,32 @@ void setUp(void) {
|
||||
void tearDown(void) {
|
||||
}
|
||||
|
||||
void test_add_should_AddNumbersTogether(void) {
|
||||
TEST_ASSERT_EQUAL_INT32(32, 16+16);
|
||||
void test_cardWriteDeck_should_WriteCardsToArray() {
|
||||
card_t cards[CARD_DECK_SIZE];
|
||||
cardWriteDeck(cards);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_CLUBS_TWO, cards[0]);
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_CLUBS_THREE, cards[1]);
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_CLUBS_FOUR, cards[2]);
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_CLUBS_ACE, cards[12]);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_DIAMONDS_NINE, cards[20]);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_HEARTS_ACE, cards[38]);
|
||||
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_SPADES_ACE, cards[51]);
|
||||
}
|
||||
|
||||
void test_cardWriteDeck_should_ReturnCardsWritten() {
|
||||
card_t cards[CARD_DECK_SIZE];
|
||||
TEST_ASSERT_EQUAL_UINT8(CARD_DECK_SIZE, cardWriteDeck(cards));
|
||||
}
|
||||
|
||||
int main() {
|
||||
UNITY_BEGIN();
|
||||
|
||||
RUN_TEST(test_add_should_AddNumbersTogether);
|
||||
RUN_TEST(test_cardWriteDeck_should_WriteCardsToArray);
|
||||
RUN_TEST(test_cardWriteDeck_should_ReturnCardsWritten);
|
||||
|
||||
return UNITY_END();
|
||||
}
|
Reference in New Issue
Block a user