Skip to content
This repository has been archived by the owner on Jan 23, 2024. It is now read-only.

Commit

Permalink
Testing CI
Browse files Browse the repository at this point in the history
  • Loading branch information
JarandJR committed Oct 3, 2023
1 parent 0212ca0 commit f309095
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ name: CI with fuzzing and tests with address sanitizer

on:
push:
branches:
- main
paths:
- 'oving5/**'
branches: [ "main" ]
workflow_dispatch:

jobs:
build-test-fuzz:
Expand All @@ -28,7 +28,7 @@ jobs:
cd oving5/build
CC=clang cmake ..
make
- name: Run Tests
run: |
cd oving5/build
Expand Down
4 changes: 2 additions & 2 deletions oving5/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: CI with fuzzing and tests with address sanitizer
on:
push:
branches:
- main
- main
paths:
- 'oving5/**'

Expand All @@ -28,7 +28,7 @@ jobs:
cd oving5/build
CC=clang cmake ..
make
- name: Run Tests
run: |
cd oving5/build
Expand Down
6 changes: 3 additions & 3 deletions oving5/format_string.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#ifndef FORMAT_H
#define FORMAT_H
#ifndef FORMAT_STRING_H
#define FORMAT_STRING_H

char* format(char *in);
char* format_string(char *in);

#endif
3 changes: 2 additions & 1 deletion oving5/main.c
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "format_string.h"

int main() {
char in [30];
strcpy(in, "This is a <test> & example.");
printf("%s\n", format(in));
printf("%s\n", format_string(in));
return 0;
}
6 changes: 3 additions & 3 deletions oving5/tests/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
add_executable(format_string_test format_string_test.c)
target_link_libraries(format_string_test format_string)
target_link_libraries(format_string_test format)
target_compile_options(format_string_test PRIVATE -fsanitize=address)
target_link_options(format_string_test PRIVATE -fsanitize=address)
add_test(NAME format_string_test COMMAND format_string_test)

add_executable(fuzz_test fuzz_test.c)
target_link_libraries(fuzz_test fuzz)
target_compile_options(fuzz_test PRIVATE -fsanitize=address,fuzzer)
target_link_options(fuzz_test PRIVATE -fsanitize=address,fuzzer)
target_compile_options(fuzz_test PRIVATE -fsanitize=fuzzer,address)
target_link_options(fuzz_test PRIVATE -fsanitize=fuzzer,address)

0 comments on commit f309095

Please sign in to comment.