Skip to content

Commit

Permalink
Squashed 'externals/coda-oss/' changes from c2fc5fc66..f70b4202f
Browse files Browse the repository at this point in the history
f70b4202f account for coda-oss.vcxproj being in other SLNs
af3faebfc Remove more compiler/code-analysis warnings (#699)
82be2a6db unittests should work w/o install (#698)
dbb90a06d add msbuild for coda-oss.sln (#697)
5a417140a reduce compiler warnings (#696)
288619dfa all modules now part of coda-oss.vcxproj (#695)

git-subtree-dir: externals/coda-oss
git-subtree-split: f70b4202f19f260941a0245e41301ae232348fc7
  • Loading branch information
Dan Smith authored and Dan Smith committed Jul 10, 2023
1 parent ea623b4 commit 3b07146
Show file tree
Hide file tree
Showing 160 changed files with 2,366 additions and 833 deletions.
36 changes: 25 additions & 11 deletions .github/workflows/build_unittest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,33 @@ jobs:
cd ..
cd target-Debug
cmake --build . --config Debug -j
- name: install
- name: test
# should run w/o install
run: |
cd target-Release
cmake --build . --config Release --target install
ctest -C Release --output-on-failure
cd ..
cd target-Debug
cmake --build . --config Debug --target install
- name: test
ctest -C Debug --output-on-failure
- name: install
run: |
cd target-Release
ctest -C Release --output-on-failure
cmake --build . --config Release --target install
cd ..
cd target-Debug
ctest -C Debug --output-on-failure
cmake --build . --config Debug --target install
cd ..
- name: Add msbuild to PATH
uses: microsoft/[email protected]
with:
msbuild-architecture: x64
- name: msbuild
run: |
msbuild coda-oss.sln /p:configuration=Release
msbuild coda-oss.sln /p:configuration=Debug
#- name: mstest
# run: |
# mstest /testcontainer:${RUNNER_WORKSPACE}\coda-oss\x64\Debug\UnitTest.dll

build-linux-cmake:
strategy:
Expand Down Expand Up @@ -79,22 +92,23 @@ jobs:
cd target
# "-j" spawns too many processes causing GCC to crash
cmake --build . -j 12
- name: install
run: |
cd target
cmake --build . --target install
- name: test
# should run w/o install
run: |
cd target
ctest --output-on-failure
- name: install
run: |
cd target
cmake --build . --target install
build-waf:
strategy:
matrix:
os: [ubuntu-latest, windows-2019]
python-version: ['3.7']
debugging: ['--enable-debugging', '']
name: ${{ matrix.os }}-${{ matrix.python-version }}-waf
name: ${{ matrix.os }}-${{ matrix.python-version }}-waf${{ matrix.debugging }}
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand Down
1 change: 1 addition & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ if (${CMAKE_PROJECT_NAME} STREQUAL coda-oss)
endif()
elseif (UNIX)
add_compile_options(-Werror) # warnings as errors

if (ENABLE_ASAN)
# https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html
add_compile_options(-fsanitize=address)
Expand Down
31 changes: 26 additions & 5 deletions UnitTest/UnitTest.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@
<PrecompiledHeader>Use</PrecompiledHeader>
<WarningLevel>Level4</WarningLevel>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\hdf5.lite\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;$(SolutionDir)modules\c++\zip\include\;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\hdf5.lite\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;$(SolutionDir)modules\c++\xml.lite\include\;$(SolutionDir)modules\c++\zip\include\;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include\;$(SolutionDir)\target-$(Configuration)\installwindows-latestCMake-Github\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>_DEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -75,7 +75,7 @@
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
<AdditionalLibraryDirectories>$(SolutionDir)\out\install\$(Platform)-$(Configuration)\lib\;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)\out\install\$(Platform)-$(Configuration)\lib\;$(SolutionDir)\target-$(Configuration)\installwindows-latestCMake-Github\lib\;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
Expand All @@ -85,7 +85,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\hdf5.lite\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;$(SolutionDir)modules\c++\zip\include\;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>$(VCInstallDir)UnitTest\include;$(ProjectDir);$(SolutionDir)modules\c++\;$(SolutionDir)modules\c++\avx\include\;$(SolutionDir)modules\c++\cli\include\;$(SolutionDir)modules\c++\config\include\;$(SolutionDir)modules\c++\coda_oss\include\;$(SolutionDir)modules\c++\gsl\include\;$(SolutionDir)modules\c++\hdf5.lite\include\;$(SolutionDir)modules\c++\io\include\;$(SolutionDir)modules\c++\std\include\;$(SolutionDir)modules\c++\str\include\;$(SolutionDir)modules\c++\sys\include\;$(SolutionDir)modules\c++\except\include\;$(SolutionDir)modules\c++\logging\include\;$(SolutionDir)modules\c++\math\include\;$(SolutionDir)modules\c++\math.linear\include\;$(SolutionDir)modules\c++\math.poly\include\;$(SolutionDir)modules\c++\mem\include\;$(SolutionDir)modules\c++\mt\include\;$(SolutionDir)modules\c++\polygon\include\;$(SolutionDir)modules\c++\re\include\;$(SolutionDir)modules\c++\types\include\;$(SolutionDir)modules\c++\units\include\;$(SolutionDir)modules\c++\xml.lite\include\;$(SolutionDir)modules\c++\zip\include\;$(SolutionDir)out\install\$(Platform)-$(Configuration)\include\;$(SolutionDir)\target-$(Configuration)\installwindows-latestCMake-Github\include\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<PreprocessorDefinitions>NDEBUG;%(PreprocessorDefinitions);MT_DEFAULT_PINNING=0;RE_ENABLE_STD_REGEX=1</PreprocessorDefinitions>
<UseFullPaths>true</UseFullPaths>
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
Expand All @@ -103,7 +103,7 @@
<SubSystem>Windows</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(SolutionDir)\out\install\$(Platform)-$(Configuration)\lib\;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(SolutionDir)\out\install\$(Platform)-$(Configuration)\lib\;$(SolutionDir)\target-$(Configuration)\installwindows-latestCMake-Github\lib\;$(VCInstallDir)UnitTest\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
</Link>
</ItemDefinitionGroup>
<ItemGroup>
Expand Down Expand Up @@ -355,6 +355,26 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_soapelements.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlattribute.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlcreate.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlelement.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlparser.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\modules\c++\zip\unittests\unittest_GZip.cpp">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
Expand All @@ -380,14 +400,15 @@
<ClCompile Include="sys.cpp" />
<ClCompile Include="types.cpp" />
<ClCompile Include="units.cpp" />
<ClCompile Include="xml.lite.cpp" />
<ClCompile Include="zip.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
<ClInclude Include="TestCase.h" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\modules\c++\coda-oss-lite.vcxproj">
<ProjectReference Include="..\modules\c++\coda-oss.vcxproj">
<Project>{9997e895-5161-4ddf-8f3f-099894cb2f21}</Project>
</ProjectReference>
</ItemGroup>
Expand Down
21 changes: 21 additions & 0 deletions UnitTest/UnitTest.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,24 @@
<ClCompile Include="..\modules\c++\zip\unittests\unittest_GZip.cpp">
<Filter>zip</Filter>
</ClCompile>
<ClCompile Include="xml.lite.cpp">
<Filter>xml.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_soapelements.cpp">
<Filter>xml.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlattribute.cpp">
<Filter>xml.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlcreate.cpp">
<Filter>xml.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlelement.cpp">
<Filter>xml.lite</Filter>
</ClCompile>
<ClCompile Include="..\modules\c++\xml.lite\unittests\test_xmlparser.cpp">
<Filter>xml.lite</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="pch.h" />
Expand Down Expand Up @@ -300,5 +318,8 @@
<Filter Include="zip">
<UniqueIdentifier>{223c163f-0321-4935-8e20-0e05f048adf0}</UniqueIdentifier>
</Filter>
<Filter Include="xml.lite">
<UniqueIdentifier>{f4dfc761-e468-4305-84dc-f3579e46107e}</UniqueIdentifier>
</Filter>
</ItemGroup>
</Project>
2 changes: 2 additions & 0 deletions UnitTest/avx.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <avx/extractf.h>

namespace avx
{

Expand Down
3 changes: 3 additions & 0 deletions UnitTest/mem.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@

#include <import/mem.h>
#include <mem/ScratchMemory.h>
#include <mem/SharedPtr.h>
#include <mem/AutoPtr.h>
#include <mem/ComplexView.h>

namespace mem
{
Expand Down
11 changes: 11 additions & 0 deletions UnitTest/mt.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <mt/CriticalSection.h>
#include <mt/ThreadPlanner.h>
#include <mt/ThreadGroup.h>
#include <mt/BalancedRunnable1D.h>
#include <mt/CPUAffinityInitializer.h>
#include <mt/CPUAffinityThreadInitializer.h>
#include <mt/RequestQueue.h>
#include <mt/ThreadPoolException.h>
#include <mt/GenerationThreadPool.h>
#include <mt/ThreadedByteSwap.h>

namespace mt
{

Expand Down
78 changes: 16 additions & 62 deletions UnitTest/pch.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,81 +24,35 @@
#include <assert.h>

#include "import/std.h"

#include <std/string>
#include <std/span>
#include <std/optional>
#include <std/cstddef>
#include <std/bit>
#include <std/cstddef>
#include <std/filesystem>
#include <std/bit> // std::endian
#include <std/numbers>
#include <std/optional>
#include <std/span>
#include <std/string>
#include <std/type_traits>

#include "CppUnitTest.h"

#include "coda_oss/span.h"
#include "gsl/gsl.h"
#include "import/sys.h"
#include "import/math.h"
#include "import/str.h"
#include "str/EncodedStringView.h"
#include "import/except.h"
#include "import/mem.h"
#include <mem/SharedPtr.h>
#include <mem/AutoPtr.h>
#include <mem/ComplexView.h>
#include "import/cli.h"
#include "polygon/DrawPolygon.h"
#include "polygon/PolygonMask.h"
#include <types/RowCol.h>
#include <types/PageRowCol.h>
#include <types/RangeList.h>
#include <types/Range.h>
#include <types/Complex.h>
#include <sys/Conf.h>
#include <sys/Path.h>
#include <except/Exception.h>
#include <str/Convert.h>
#include <sys/AtomicCounter.h>
#include <sys/Runnable.h>
#include <sys/Thread.h>
#include <sys/Conf.h>
#include <sys/ConditionVar.h>
#include <sys/LocalDateTime.h>
#include <sys/UTCDateTime.h>
#include <sys/OS.h>
#include <sys/Path.h>
#include <sys/Backtrace.h>
#include <sys/Dbg.h>
#include <sys/DateTime.h>
#include <sys/sys_filesystem.h>
#include <except/Error.h>
#include <sys/Runnable.h>
#include <sys/Thread.h>
#include <sys/Mutex.h>
#include <sys/FileFinder.h>
#include <sys/ByteSwap.h>
#include <gsl/gsl.h>
#include <import/except.h>
#include <import/str.h>
#include <import/sys.h>
#include <import/math.h>
#include <import/math/linear.h>
#include <import/math/poly.h>
#include <mt/CriticalSection.h>
#include <mt/ThreadPlanner.h>
#include <mt/ThreadGroup.h>
#include <mt/BalancedRunnable1D.h>
#include <mt/CPUAffinityInitializer.h>
#include <mt/CPUAffinityThreadInitializer.h>
#include <mt/RequestQueue.h>
#include <mt/ThreadPoolException.h>
#include <mt/GenerationThreadPool.h>
#include <mt/ThreadedByteSwap.h>
#include <import/mem.h>
#include <import/cli.h>
#include <import/mt.h>
#include <avx/extractf.h>
#include <logging/ExceptionLogger.h>
#include <import/logging.h>
#include <import/re.h>
#include "io/StringStream.h"
#include <sys/FileFinder.h>
#include <import/zip.h>
#include <import/xml/lite.h>
#include <import/hdf5/lite.h>

#include <io/ReadUtils.h>
#include <hdf5/lite/highfive.h>

#include "TestCase.h"

Expand Down
3 changes: 3 additions & 0 deletions UnitTest/polygon.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <polygon/DrawPolygon.h>
#include <polygon/PolygonMask.h>

namespace polygon
{
TEST_CLASS(test_polygon_mask){ public:
Expand Down
1 change: 1 addition & 0 deletions UnitTest/str.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

#include <import/str.h>
#include <str/EncodedString.h>
#include <str/EncodedStringView.h>

namespace str
{
Expand Down
21 changes: 21 additions & 0 deletions UnitTest/sys.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,27 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <import/sys.h>
#include <sys/Runnable.h>
#include <sys/Thread.h>
#include <sys/Mutex.h>
#include <sys/FileFinder.h>
#include <sys/ByteSwap.h>
#include <sys/AtomicCounter.h>
#include <sys/Runnable.h>
#include <sys/Thread.h>
#include <sys/Conf.h>
#include <sys/ConditionVar.h>
#include <sys/LocalDateTime.h>
#include <sys/UTCDateTime.h>
#include <sys/OS.h>
#include <sys/Path.h>
#include <sys/Backtrace.h>
#include <sys/Dbg.h>
#include <sys/DateTime.h>
#include <sys/Conf.h>
#include <sys/Path.h>

namespace sys
{
TEST_CLASS(test_aligned_alloc){ public:
Expand Down
6 changes: 6 additions & 0 deletions UnitTest/types.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
#include "pch.h"
#include "CppUnitTest.h"

#include <types/RowCol.h>
#include <types/PageRowCol.h>
#include <types/RangeList.h>
#include <types/Range.h>
#include <types/Complex.h>

namespace types
{
TEST_CLASS(test_page_row_col){ public:
Expand Down
Loading

0 comments on commit 3b07146

Please sign in to comment.