mirror of
https://github.com/bkthomps/Containers.git
synced 2025-11-16 04:24:47 +00:00
Add windows and macOS tests (#148)
Update the github actions workflow to v3 and add windows and macOS tests.
This commit is contained in:
48
.github/workflows/build.yml
vendored
48
.github/workflows/build.yml
vendored
@@ -2,28 +2,52 @@ name: build
|
||||
on: [push]
|
||||
jobs:
|
||||
debug:
|
||||
runs-on: ubuntu-latest
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- run: make test_debug
|
||||
- run: ./ContainersTestDebug
|
||||
optimized:
|
||||
runs-on: ubuntu-latest
|
||||
- run: ./ContainersTest
|
||||
debug_windows:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- run: make test_debug_no_malloc_fail
|
||||
- run: ./ContainersTest
|
||||
optimized:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, macos-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: make test_optimized
|
||||
- run: ./ContainersTestOptimized
|
||||
- run: ./ContainersTest
|
||||
optimized_windows:
|
||||
runs-on: ${{ matrix.os }}
|
||||
strategy:
|
||||
matrix:
|
||||
os: [windows-latest]
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- run: make test_optimized_no_malloc_fail
|
||||
- run: ./ContainersTest
|
||||
coverage:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- run: make test_coverage
|
||||
- run: ./ContainersTestCoverage
|
||||
- run: ./ContainersTest
|
||||
- run: bash <(curl -s https://codecov.io/bash)
|
||||
valgrind:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions/checkout@v3
|
||||
- run: sudo apt install -y valgrind
|
||||
- run: make test_valgrind
|
||||
- run: valgrind --leak-check=full --error-exitcode=1 ./ContainersTestValgrind
|
||||
- run: make test_debug_no_malloc_fail
|
||||
- run: valgrind --leak-check=full --error-exitcode=1 ./ContainersTest
|
||||
|
||||
2
LICENSE
2
LICENSE
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2017-2020 Bailey Thompson
|
||||
Copyright (c) 2017-2022 Bailey Thompson
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
21
Makefile
21
Makefile
@@ -23,15 +23,20 @@ header:
|
||||
python3 compile_headers.py $(version)
|
||||
|
||||
test_debug:
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -o ContainersTestDebug
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -o ContainersTest
|
||||
|
||||
test_optimized:
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O3 -ldl -o ContainersTestOptimized
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O3 -ldl -o ContainersTest
|
||||
|
||||
test_debug_no_malloc_fail:
|
||||
@sed -i 's/STUB_MALLOC 1/STUB_MALLOC 0/g' tst/test.h
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -o ContainersTest
|
||||
@sed -i 's/STUB_MALLOC 0/STUB_MALLOC 1/g' tst/test.h
|
||||
|
||||
test_optimized_no_malloc_fail:
|
||||
@sed -i 's/STUB_MALLOC 1/STUB_MALLOC 0/g' tst/test.h
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O3 -o ContainersTest
|
||||
@sed -i 's/STUB_MALLOC 0/STUB_MALLOC 1/g' tst/test.h
|
||||
|
||||
test_coverage:
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -g -coverage -o ContainersTestCoverage
|
||||
|
||||
test_valgrind:
|
||||
@sed -i 's/STUB_MALLOC 1/STUB_MALLOC 0/g' tst/test.h
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -o ContainersTestValgrind
|
||||
@sed -i 's/STUB_MALLOC 0/STUB_MALLOC 1/g' tst/test.h
|
||||
@gcc src/*.c tst/*.c -Wall -Wextra -Wpedantic -Werror -std=c89 -O0 -ldl -g -coverage -o ContainersTest
|
||||
|
||||
@@ -638,6 +638,7 @@ static int compare_dummy(const void *const one, const void *const two)
|
||||
(void) one;
|
||||
(void) two;
|
||||
assert(0);
|
||||
return 5;
|
||||
}
|
||||
|
||||
static void test_big_object(void)
|
||||
|
||||
@@ -18,8 +18,9 @@ static unsigned long hash_int(const void *const key)
|
||||
return hash;
|
||||
}
|
||||
|
||||
static unsigned long bad_hash_int()
|
||||
static unsigned long bad_hash_int(const void *const key)
|
||||
{
|
||||
(void) key;
|
||||
return 5;
|
||||
}
|
||||
|
||||
@@ -419,9 +420,12 @@ static int compare_big_object(const void *const one, const void *const two)
|
||||
return a->n - b->n;
|
||||
}
|
||||
|
||||
static int compare_dummy()
|
||||
static int compare_dummy(const void *const one, const void *const two)
|
||||
{
|
||||
(void) one;
|
||||
(void) two;
|
||||
assert(0);
|
||||
return 5;
|
||||
}
|
||||
|
||||
static void test_big_object(void)
|
||||
|
||||
@@ -18,8 +18,9 @@ static unsigned long hash_int(const void *const key)
|
||||
return hash;
|
||||
}
|
||||
|
||||
static unsigned long bad_hash_int()
|
||||
static unsigned long bad_hash_int(const void *const key)
|
||||
{
|
||||
(void) key;
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,9 @@ static unsigned long hash_int(const void *const key)
|
||||
return hash;
|
||||
}
|
||||
|
||||
static unsigned long bad_hash_int()
|
||||
static unsigned long bad_hash_int(const void *const key)
|
||||
{
|
||||
(void) key;
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user