diff options
| author | Thomas Schmucker <ts@its1.de> | 2025-04-13 22:43:46 +0200 |
|---|---|---|
| committer | Thomas Schmucker <ts@its1.de> | 2025-04-13 22:43:46 +0200 |
| commit | 7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3 (patch) | |
| tree | ea1c5bc19dfe6bacad2d377378c460ee5284e74e /tests | |
| parent | 85fe3b67a67825dfc5e43959f001b2a7159dc23f (diff) | |
| download | libcsv-7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3.tar.gz libcsv-7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3.tar.bz2 libcsv-7d956c533e9fd7d3bbb9a4a8b7f89f0fe54d4bc3.zip | |
first draft
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/.clang-format | 45 | ||||
| -rw-r--r-- | tests/.clang-tidy | 19 | ||||
| -rw-r--r-- | tests/compile_flags.txt | 8 | ||||
| -rw-r--r-- | tests/config.mk | 3 | ||||
| -rw-r--r-- | tests/makefile | 24 |
5 files changed, 99 insertions, 0 deletions
diff --git a/tests/.clang-format b/tests/.clang-format new file mode 100644 index 0000000..b32bad6 --- /dev/null +++ b/tests/.clang-format | |||
| @@ -0,0 +1,45 @@ | |||
| 1 | --- | ||
| 2 | AccessModifierOffset: -4 | ||
| 3 | AlignConsecutiveAssignments: 'true' | ||
| 4 | AlignConsecutiveDeclarations: 'true' | ||
| 5 | AlignEscapedNewlines: Left | ||
| 6 | AlignTrailingComments: 'true' | ||
| 7 | AlwaysBreakAfterReturnType: TopLevelDefinitions | ||
| 8 | BreakBeforeBraces: Stroustrup | ||
| 9 | BreakConstructorInitializers: BeforeComma | ||
| 10 | BreakInheritanceList: BeforeComma | ||
| 11 | ColumnLimit: '0' | ||
| 12 | CompactNamespaces: 'false' | ||
| 13 | Cpp11BracedListStyle: 'false' | ||
| 14 | FixNamespaceComments: 'true' | ||
| 15 | IncludeBlocks: Regroup | ||
| 16 | IncludeCategories: | ||
| 17 | - Regex: '^.*(precomp|pch|stdafx)' | ||
| 18 | Priority: -1 | ||
| 19 | - Regex: '^<.*>' | ||
| 20 | Priority: 1 | ||
| 21 | - Regex: '^".*"' | ||
| 22 | Priority: 2 | ||
| 23 | - Regex: '.*' | ||
| 24 | Priority: 3 | ||
| 25 | IndentCaseLabels: 'false' | ||
| 26 | IndentPPDirectives: AfterHash | ||
| 27 | IndentWidth: '4' | ||
| 28 | IndentWrappedFunctionNames: 'false' | ||
| 29 | KeepEmptyLinesAtTheStartOfBlocks: 'false' | ||
| 30 | PointerAlignment: Right | ||
| 31 | SortIncludes: 'true' | ||
| 32 | SpaceAfterCStyleCast: 'true' | ||
| 33 | SpaceAfterTemplateKeyword: 'false' | ||
| 34 | SpaceBeforeAssignmentOperators: 'true' | ||
| 35 | SpaceBeforeParens: ControlStatements | ||
| 36 | SpaceBeforeRangeBasedForLoopColon: 'false' | ||
| 37 | SpaceInEmptyParentheses: 'false' | ||
| 38 | SpacesInAngles: 'false' | ||
| 39 | SpacesInCStyleCastParentheses: 'false' | ||
| 40 | SpacesInConditionalStatement: 'true' | ||
| 41 | SpacesInParentheses: 'false' | ||
| 42 | Standard: Auto | ||
| 43 | TabWidth: '4' | ||
| 44 | UseTab: ForIndentation | ||
| 45 | ... | ||
diff --git a/tests/.clang-tidy b/tests/.clang-tidy new file mode 100644 index 0000000..0bceb5b --- /dev/null +++ b/tests/.clang-tidy | |||
| @@ -0,0 +1,19 @@ | |||
| 1 | --- | ||
| 2 | Checks: "*, | ||
| 3 | -abseil-*, | ||
| 4 | -altera-*, | ||
| 5 | -android-*, | ||
| 6 | -fuchsia-*, | ||
| 7 | -google-*, | ||
| 8 | -llvm*, | ||
| 9 | -modernize-use-trailing-return-type, | ||
| 10 | -zircon-*, | ||
| 11 | -readability-else-after-return, | ||
| 12 | -readability-static-accessed-through-instance, | ||
| 13 | -readability-avoid-const-params-in-decls, | ||
| 14 | -cppcoreguidelines-non-private-member-variables-in-classes, | ||
| 15 | -misc-non-private-member-variables-in-classes, | ||
| 16 | " | ||
| 17 | WarningsAsErrors: '' | ||
| 18 | HeaderFilterRegex: '' | ||
| 19 | FormatStyle: none | ||
diff --git a/tests/compile_flags.txt b/tests/compile_flags.txt new file mode 100644 index 0000000..9352ecc --- /dev/null +++ b/tests/compile_flags.txt | |||
| @@ -0,0 +1,8 @@ | |||
| 1 | -Wall | ||
| 2 | -Wextra | ||
| 3 | -Wsign-compare | ||
| 4 | -Wsign-conversion | ||
| 5 | -pedantic | ||
| 6 | -std=c99 | ||
| 7 | -O2 | ||
| 8 | -I../lib/include | ||
diff --git a/tests/config.mk b/tests/config.mk new file mode 100644 index 0000000..4b51d37 --- /dev/null +++ b/tests/config.mk | |||
| @@ -0,0 +1,3 @@ | |||
| 1 | BUILD_DIR=../build | ||
| 2 | CFLAGS=-Wall -Wextra -Wsign-compare -Wsign-conversion -pedantic -std=c99 -O2 -I../lib/include | ||
| 3 | LDFLAGS=-L$(BUILD_DIR) -lcsv | ||
diff --git a/tests/makefile b/tests/makefile index e69de29..2300a19 100644 --- a/tests/makefile +++ b/tests/makefile | |||
| @@ -0,0 +1,24 @@ | |||
| 1 | include config.mk | ||
| 2 | |||
| 3 | TEST_RUNNER=$(BUILD_DIR)/tester | ||
| 4 | OBJS=$(BUILD_DIR)/csv-test.o | ||
| 5 | |||
| 6 | $(TEST_RUNNER): $(OBJS) | libcsv | ||
| 7 | cc -o $@ $(LDFLAGS) $(OBJS) | ||
| 8 | |||
| 9 | $(BUILD_DIR)/%.o: src/%.c | $(BUILD_DIR) | ||
| 10 | cc $(CFLAGS) -c $< -o $@ | ||
| 11 | |||
| 12 | $(BUILD_DIR): | ||
| 13 | mkdir -p $@ | ||
| 14 | |||
| 15 | .PHONY: libcsv | ||
| 16 | libcsv: | ||
| 17 | $(MAKE) -C ../lib | ||
| 18 | |||
| 19 | compile_flags.txt: | ||
| 20 | echo "$(CFLAGS)" | tr ' ' '\n' > $@ | ||
| 21 | |||
| 22 | .PHONY: clean | ||
| 23 | clean: | ||
| 24 | rm -f $(TEST_RUNNER) $(OBJS) | ||
