Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Macosx test #110

Open
wants to merge 11 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 38 additions & 1 deletion .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ jobs:
run: make clean && CC=clang LDFLAGS='-fsanitize=address -fno-omit-frame-pointer' CFLAGS='-Og -fsanitize=address -fno-omit-frame-pointer' ./configure

- name: Run testsuite with ASAN
run: make test
run: VERBOSE=1 make test

- name: Make schaufel with ASAN
run: make
Expand Down Expand Up @@ -96,3 +96,40 @@ jobs:
make install
src/schaufel -c 1 -i f -p 1 -o f -f src/main.c -F main.c
diff -q src/main.c main.c
pr-test-macosx:
name: Test Schaufel on MacOSX
runs-on: ${{ matrix.os }}
strategy:
matrix:
# also test 'latest', eventually this will be upgraded to a newer version and might fail early
os: [macos-11, macos-12, macos-latest]

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Versions
run: echo "${{ matrix.os }}"

- name: Install Deps
run: brew install gcc autoconf automake libtool libconfig librdkafka hiredis libpq json-c

# do the actual compilation
- name: Configure
run: autoreconf --force -i && ./configure

- name: Run testsuite
run: make test

- name: Make
run: make

# install schaufel
- name: Install Schaufel
run: sudo make install

- name: Run simple schaufel test
run: src/schaufel -c 1 -i f -p 1 -o f -f src/main.c -F main.c

- name: test output
run: diff -q src/main.c main.c
21 changes: 17 additions & 4 deletions t/logger_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,34 +25,47 @@ int main()

// test full file definition
logger = _config_init(&root);
logger_parse("FILE:0644:/tmp/schaufel_logtest",logger);
logger_parse("FILE:0644:./schaufel_logtest",logger);
pretty_assert(logger_validate(logger) == true);
logger = config_lookup(&root,"logger");
logger_init(logger);
logger_log("testmessage file 1");
// We can't actually compare mode because
// umask might influence result
unlink("/tmp/schaufel_logtest");
unlink("./schaufel_logtest");

logger_free();

// test file
logger = _config_init(&root);
logger_parse("/tmp/schaufel_logtest2",logger);
logger_parse("./schaufel_logtest2",logger);
pretty_assert(logger_validate(logger) == true);
printf("%s %d: here", __FILE__, __LINE__);
logger = config_lookup(&root,"logger");
printf("%s %d: here", __FILE__, __LINE__);
logger_init(logger);
printf("%s %d: here", __FILE__, __LINE__);
logger_log("testmessage file 2");
unlink("/tmp/schaufel_logtest2");
printf("%s %d: here", __FILE__, __LINE__);
unlink("./schaufel_logtest2");
printf("%s %d: here", __FILE__, __LINE__);
logger_free();
printf("%s %d: here", __FILE__, __LINE__);

// stderr (not a test)
printf("%s %d: here", __FILE__, __LINE__);
logger = _config_init(&root);
printf("%s %d: here", __FILE__, __LINE__);
logger_parse("STDERR",logger);
printf("%s %d: here", __FILE__, __LINE__);
pretty_assert(logger_validate(logger) == true);
printf("%s %d: here", __FILE__, __LINE__);
logger = config_lookup(&root,"logger");
printf("%s %d: here", __FILE__, __LINE__);
logger_init(logger);
printf("%s %d: here", __FILE__, __LINE__);
logger_log("testmessage stderr");
printf("%s %d: here", __FILE__, __LINE__);
logger_free();

// stdout (not a test)
Expand Down