diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000000000000000000000000000000000..7548f76b9b80cc6c1725505ab0492be1d7e3317a --- /dev/null +++ b/.clang-format @@ -0,0 +1,151 @@ +AccessModifierOffset: -4 + +AlignAfterOpenBracket: DontAlign +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignConsecutiveMacros: true +AlignEscapedNewlines: DontAlign +AlignOperands: false +AlignTrailingComments: true + +AllowAllArgumentsOnNextLine: true +AllowAllConstructorInitializersOnNextLine: true +AllowAllParametersOfDeclarationOnNextLine: false +AllowShortBlocksOnASingleLine: Empty +AllowShortCaseLabelsOnASingleLine: true +AllowShortFunctionsOnASingleLine: Empty +AllowShortIfStatementsOnASingleLine: Never +AllowShortLambdasOnASingleLine: Inline +AllowShortLoopsOnASingleLine: false + +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: true +AlwaysBreakTemplateDeclarations: Yes + +BinPackArguments: false +BinPackParameters: true + +BreakBeforeBraces: Custom +BraceWrapping: + AfterCaseLabel: false + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: false + SplitEmptyRecord: false + SplitEmptyNamespace: true + +BreakBeforeBinaryOperators: None +BreakBeforeTernaryOperators: false +BreakConstructorInitializers: BeforeComma +BreakInheritanceList: BeforeComma +BreakStringLiterals: true + +ColumnLimit: 140 + +CommentPragmas: '' + +CompactNamespaces: false + +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 + +ContinuationIndentWidth: 4 + +Cpp11BracedListStyle: true + +DerivePointerAlignment: false + +DisableFormat: false + +FixNamespaceComments: true + +ForEachMacros: + - Q_FOREACH + - BOOST_FOREACH + - FOREACH + - FOR_EACH + +IncludeBlocks: Regroup +IncludeCategories: + - Regex: '^<' + Priority: 2 + - Regex: '.*' + Priority: 1 +IncludeIsMainRegex: '(_test)?$' + +IndentCaseLabels: true +IndentGotoLabels: false +IndentPPDirectives: None +IndentWidth: 4 +IndentWrappedFunctionNames: false + +KeepEmptyLinesAtTheStartOfBlocks: false + +Language: Cpp + +MacroBlockBegin: '' +MacroBlockEnd: '' + +MaxEmptyLinesToKeep: 1 + +NamespaceIndentation: None +NamespaceMacros: + - NAMESPACE + +PenaltyBreakAssignment: 100 +PenaltyBreakBeforeFirstCallParameter: 10 +PenaltyBreakComment: 10 +PenaltyBreakFirstLessLess: 100 +PenaltyBreakString: 10 +PenaltyBreakTemplateDeclaration: 10000 +PenaltyExcessCharacter: 999999 +PenaltyReturnTypeOnItsOwnLine: 10000 + +PointerAlignment: Left + +ReflowComments: false + +SortIncludes: true +SortUsingDeclarations: true + +SpaceAfterCStyleCast: false +SpaceAfterLogicalNot: false +SpaceAfterTemplateKeyword: true +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyBlock: false +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 1 +SpacesInAngles: false +SpacesInCStyleCastParentheses: false +SpacesInContainerLiterals: false +SpacesInParentheses: false +SpacesInSquareBrackets: false + +Standard: Cpp11 + +StatementMacros: + - Q_UNUSED + +TabWidth: 4 + +TypenameMacros: + - STACK_OF + - LIST + - LIST_ENTRY + +UseTab: ForContinuationAndIndentation \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 433d2746392261a745573dc457bbb579cdc96dcb..ab4d1bf5b9226b71abff112bf9e01b5b2e7e5467 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -75,10 +75,14 @@ add_custom_target( copy_python_dir ALL COMMAND ${CMAKE_COMMAND} -E copy_directory "${CMAKE_CURRENT_LIST_DIR}/${LIBRARY_NAME}" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LIBRARY_NAME}" COMMENT "Copying python files to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${LIBRARY_NAME}" - DEPENDS remove_old_python_dir + DEPENDS "${TARGET_NAME}" remove_old_python_dir ) add_custom_target( copy_misc_files ALL COMMAND ${CMAKE_COMMAND} -E copy "${CMAKE_CURRENT_LIST_DIR}/README.md" "${CMAKE_CURRENT_LIST_DIR}/LICENSE" "${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" COMMENT "Copying misc. files to ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}" -) \ No newline at end of file + DEPENDS "${TARGET_NAME}" +) + +enable_testing() +add_subdirectory(test) \ No newline at end of file diff --git a/README.md b/README.md index bcd09857e6f6c320c32c56f5182de4e1469370f3..54440d52dcfd1523bfc3c5a6b02a65c25cf66e95 100644 --- a/README.md +++ b/README.md @@ -62,13 +62,13 @@ python3 setup.py sdist The output gets written to `B-ASIC/dist/b-asic-<version>.tar.gz`. #### Installation (Binary distribution) -In `B-ASIC`: +In `B-ASIC/dist`: ``` python3 -m pip install b_asic-<version>-<python_tag>-<abi_tag>-<platform_tag>.whl ``` #### Installation (Source distribution) -In `B-ASIC`: +In `B-ASIC/dist`: ``` python3 -m pip install b-asic-<version>.tar.gz ``` diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt new file mode 100644 index 0000000000000000000000000000000000000000..c9fd7f20850814d9fb120e9f37989510252fc6c4 --- /dev/null +++ b/test/CMakeLists.txt @@ -0,0 +1,9 @@ +cmake_minimum_required(VERSION 3.13) + +project("B-ASIC-test") + +add_executable( + test-main + "${CMAKE_CURRENT_SOURCE_DIR}/test_main.cpp" +) +add_test(NAME test-main COMMAND test-main) \ No newline at end of file diff --git a/test/test_main.cpp b/test/test_main.cpp new file mode 100644 index 0000000000000000000000000000000000000000..30ea92f72c809f93536d8a182d5cf529a07391c8 --- /dev/null +++ b/test/test_main.cpp @@ -0,0 +1,5 @@ +// TODO: Tests + +int main() { + return 0; +} \ No newline at end of file