aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/.clang-format45
-rw-r--r--tests/.clang-tidy19
-rw-r--r--tests/compile_flags.txt8
-rw-r--r--tests/config.mk3
-rw-r--r--tests/makefile24
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---
2AccessModifierOffset: -4
3AlignConsecutiveAssignments: 'true'
4AlignConsecutiveDeclarations: 'true'
5AlignEscapedNewlines: Left
6AlignTrailingComments: 'true'
7AlwaysBreakAfterReturnType: TopLevelDefinitions
8BreakBeforeBraces: Stroustrup
9BreakConstructorInitializers: BeforeComma
10BreakInheritanceList: BeforeComma
11ColumnLimit: '0'
12CompactNamespaces: 'false'
13Cpp11BracedListStyle: 'false'
14FixNamespaceComments: 'true'
15IncludeBlocks: Regroup
16IncludeCategories:
17 - Regex: '^.*(precomp|pch|stdafx)'
18 Priority: -1
19 - Regex: '^<.*>'
20 Priority: 1
21 - Regex: '^".*"'
22 Priority: 2
23 - Regex: '.*'
24 Priority: 3
25IndentCaseLabels: 'false'
26IndentPPDirectives: AfterHash
27IndentWidth: '4'
28IndentWrappedFunctionNames: 'false'
29KeepEmptyLinesAtTheStartOfBlocks: 'false'
30PointerAlignment: Right
31SortIncludes: 'true'
32SpaceAfterCStyleCast: 'true'
33SpaceAfterTemplateKeyword: 'false'
34SpaceBeforeAssignmentOperators: 'true'
35SpaceBeforeParens: ControlStatements
36SpaceBeforeRangeBasedForLoopColon: 'false'
37SpaceInEmptyParentheses: 'false'
38SpacesInAngles: 'false'
39SpacesInCStyleCastParentheses: 'false'
40SpacesInConditionalStatement: 'true'
41SpacesInParentheses: 'false'
42Standard: Auto
43TabWidth: '4'
44UseTab: 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---
2Checks: "*,
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"
17WarningsAsErrors: ''
18HeaderFilterRegex: ''
19FormatStyle: 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 @@
1BUILD_DIR=../build
2CFLAGS=-Wall -Wextra -Wsign-compare -Wsign-conversion -pedantic -std=c99 -O2 -I../lib/include
3LDFLAGS=-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 @@
1include config.mk
2
3TEST_RUNNER=$(BUILD_DIR)/tester
4OBJS=$(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
16libcsv:
17 $(MAKE) -C ../lib
18
19compile_flags.txt:
20 echo "$(CFLAGS)" | tr ' ' '\n' > $@
21
22.PHONY: clean
23clean:
24 rm -f $(TEST_RUNNER) $(OBJS)