-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from LBNL-ETA/October2024Updates
October2024 updates
- Loading branch information
Showing
11 changed files
with
96 additions
and
128 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ '**' ] | ||
pull_request: | ||
branches: [ '**' ] | ||
|
||
jobs: | ||
build-and-test: | ||
name: ${{ matrix.os }} Build and Test | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
matrix: | ||
os: [ubuntu-latest, windows-latest, macos-latest] | ||
# For more specific OS versions, you can specify them explicitly: | ||
# os: [ubuntu-20.04, windows-2019, macos-11] | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v3 | ||
|
||
- name: Set up CMake | ||
uses: jwlawson/actions-setup-cmake@v1 | ||
with: | ||
cmake-version: "3.20.0" # Specify the minimum version you need | ||
|
||
- name: Install dependencies (Windows) | ||
if: runner.os == 'Windows' | ||
run: | | ||
choco install -y ninja | ||
choco install -y llvm # Clang on Windows if needed | ||
# choco install -y visualstudio2019community | ||
shell: pwsh | ||
|
||
- name: Install dependencies (Ubuntu) | ||
if: runner.os == 'Linux' | ||
run: | | ||
sudo apt-get update | ||
sudo apt-get install -y ninja-build clang | ||
- name: Install dependencies (macOS) | ||
if: runner.os == 'macOS' | ||
run: | | ||
brew update | ||
brew install ninja | ||
brew install llvm | ||
- name: Configure CMake | ||
run: | | ||
cmake -S . -B build -G Ninja -DCMAKE_CXX_COMPILER=clang++ | ||
# Or specify other options as needed | ||
- name: Build | ||
run: cmake --build build | ||
|
||
- name: Run tests | ||
run: ctest --test-dir build --output-on-failure |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
#include <gtest/gtest.h> | ||
|
||
#include "paths.h" | ||
|
||
std::string test_dir; | ||
|
||
int main( int argc, char* argv[] ) { | ||
#ifdef ENABLE_GTEST_DEBUG_MODE | ||
::testing::GTEST_FLAG(break_on_failure) = true; | ||
::testing::GTEST_FLAG(catch_exceptions) = false; | ||
#endif | ||
::testing::InitGoogleTest( &argc, argv ); | ||
test_dir = argv[1]; | ||
return RUN_ALL_TESTS(); | ||
} | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,19 @@ | ||
#include <memory> | ||
#include <gtest/gtest.h> | ||
#include <memory> | ||
#include <sstream> | ||
#include <filesystem> | ||
|
||
#include "thmxParser.hpp" | ||
|
||
#include "paths.h" | ||
|
||
extern std::string test_dir; | ||
|
||
class TestLoadCMA : public testing::Test | ||
{ | ||
protected: | ||
virtual void SetUp() | ||
{} | ||
}; | ||
|
||
|
||
TEST_F(TestLoadCMA, TestLoadCMAFromDisk) | ||
TEST(TestLoadCMA, TestLoadCMAFromDisk) | ||
{ | ||
std::filesystem::path product_path(test_dir); | ||
std::filesystem::path product_path(TEST_DATA_DIR); | ||
product_path /= "files"; | ||
product_path /= "cma_example.thmx"; | ||
auto contents = thmxParser::parseFile(product_path.string()); | ||
EXPECT_EQ(contents.fileVersion, "1"); | ||
EXPECT_EQ(contents.materials.size(), 5); | ||
EXPECT_EQ(contents.boundaryConditions.size(), 4); | ||
EXPECT_EQ(contents.polygons.size(), 5); | ||
EXPECT_EQ(contents.boundaryConditionPolygons.size(), 11); | ||
EXPECT_EQ(contents.fileVersion, "1"); | ||
EXPECT_EQ(contents.materials.size(), 5); | ||
EXPECT_EQ(contents.boundaryConditions.size(), 4); | ||
EXPECT_EQ(contents.polygons.size(), 5); | ||
EXPECT_EQ(contents.boundaryConditionPolygons.size(), 11); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
#include <memory> | ||
#include <gtest/gtest.h> | ||
#include <memory> | ||
#include <sstream> | ||
#include <filesystem> | ||
|
||
#include "thmxParser.hpp" | ||
|
||
#include "paths.h" | ||
|
||
extern std::string test_dir; | ||
|
||
class TestLoadCS03 : public testing::Test | ||
{ | ||
protected: | ||
virtual void SetUp() | ||
{} | ||
}; | ||
|
||
|
||
TEST_F(TestLoadCS03, TestLoadCS03FromDisk) | ||
TEST(TestLoadCS03, TestLoadCS03FromDisk) | ||
{ | ||
std::filesystem::path product_path(test_dir); | ||
std::filesystem::path product_path(TEST_DATA_DIR); | ||
product_path /= "files"; | ||
product_path /= "CS03.thmx"; | ||
//thmxParser::parseFile(product_path.string()); | ||
|
||
auto contents = thmxParser::parseFile(product_path.string()); | ||
EXPECT_EQ(contents.fileVersion, "1"); | ||
EXPECT_EQ(contents.boundaryConditions.size(), 4u); | ||
EXPECT_EQ(contents.materials.size(), 13u); | ||
EXPECT_EQ(contents.polygons.size(), 99u); | ||
} |