Skip to content

Commit

Permalink
Merge branch 'update/ci' into 'develop'
Browse files Browse the repository at this point in the history
Update/ci

See merge request njoy/tools!9
  • Loading branch information
whaeck committed Jan 29, 2025
2 parents 5012089 + cc038e9 commit 2562272
Show file tree
Hide file tree
Showing 9 changed files with 8 additions and 55 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/ContinuousIntegration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,15 @@ on:
pull_request:
branches: 'main'

# ubuntu-22.04 is x64
# macos-13 is intel
# macos-14 is arm64 (M1)
jobs:
build:
runs-on: ${{matrix.os}}
strategy:
matrix:
os: [ ubuntu-22.04, macos-13 ]
os: [ ubuntu-22.04, macos-13, macos-14 ]
cxx: [ clang++, g++-12 ]
build_type: [ Debug, Release ]

Expand Down
2 changes: 2 additions & 0 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ Bug fixes:
- iterator guards were added to the disco parser to avoid valgrind errors in ENDFtk.
- the stride_view iterator was missing the reference type, which is required to create vectors using these stride view iterators in C++17.

A few updates were made in the CMake files for Windows compilation issues. The GitHub CI was also updated: macos-14 (arm64 architecture) was added in addition to macos-13 (intel architecture).

## [tools v0.4.0](https://github.com/njoy/tools/pull/44)
New features:
- added a partial implementation of the C++23 ranges standard: chunk_view, chunk_by_view, stride_view and repeat_view (LLVM implementations for these views were used as models for our C++17 based implementations)
Expand Down
6 changes: 1 addition & 5 deletions src/tools/disco/BaseField/test/BaseField.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,10 @@ class TestBaseField : protected BaseField {

SCENARIO( "BaseField" ) {

std::string string = " a\t\n\r\n\f";
string += char{ std::char_traits<char>::eof() };
std::string string = "+abc";
auto iter = string.begin();
unsigned int position = 0;

string = "+abc";
position = 0;
iter = string.begin();
TestBaseField::skipPlusSign( iter, position );
CHECK( iter == string.begin() + 1 );
CHECK( position == 1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,10 @@ class TestBaseFixedWidthField : protected BaseFixedWidthField< Width > {

SCENARIO( "BaseFixedWidthField" ) {

std::string string = " a\t\n\r\n\f";
string += char{ std::char_traits<char>::eof() };
std::string string = "+abc";
auto iter = string.begin();
unsigned int position = 0;

string = "+abc";
position = 0;
iter = string.begin();
TestBaseFixedWidthField< 6 >::skipPlusSign( iter, position );
CHECK( iter == string.begin() + 1 );
CHECK( position == 1 );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,13 +103,6 @@ SCENARIO( "Integer" ) {
end = string.end();
CHECK( 123 == FreeFormatInteger::read< int >( iter, end ) );
CHECK( iter == end - 1 );

string = " +123";
string += char{ std::char_traits<char>::eof() };
iter = string.begin();
end = string.end();
CHECK( 123 == FreeFormatInteger::read< int >( iter, end ) );
CHECK( iter == end - 1 );
} // THEN
} // GIVEN

Expand Down
7 changes: 0 additions & 7 deletions src/tools/disco/FreeFormatReal/test/FreeFormatReal.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,13 +213,6 @@ SCENARIO( "Integer" ) {
end = string.end();
CHECK_THAT( 123, WithinRel( FreeFormatReal::read< double >( iter, end ) ) );
CHECK( iter == end - 1 );

string = " +123";
string += char{ std::char_traits<char>::eof() };
iter = string.begin();
end = string.end();
CHECK_THAT( 123, WithinRel( FreeFormatReal::read< double >( iter, end ) ) );
CHECK( iter == end - 1 );
} // THEN
} // GIVEN

Expand Down
7 changes: 0 additions & 7 deletions src/tools/disco/Integer/test/Integer.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -84,13 +84,6 @@ SCENARIO( "Integer" ) {
end = string.end();
CHECK( 123 == Integer< 10 >::read< int >( begin, end ) );
CHECK( begin == end - 1 );

string = " +123";
string += char{ std::char_traits<char>::eof() };
begin = string.begin();
end = string.end();
CHECK( 123 == Integer< 10 >::read< int >( begin, end ) );
CHECK( begin == end - 1 );
} // THEN
} // GIVEN

Expand Down
7 changes: 0 additions & 7 deletions src/tools/disco/Real/test/Real.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -218,13 +218,6 @@ SCENARIO( "Real" ) {
end = string.end();
CHECK_THAT( 123, WithinRel( Real< 10 >::read< double >( begin, end ) ) );
CHECK( begin == end - 1 );

string = " +123";
string += char{ std::char_traits<char>::eof() };
begin = string.begin();
end = string.end();
CHECK_THAT( 123, WithinRel( Real< 10 >::read< double >( begin, end ) ) );
CHECK( begin == end - 1 );
} // THEN
} // GIVEN

Expand Down
16 changes: 0 additions & 16 deletions src/tools/disco/functions/test/functions.test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ using namespace njoy::tools::disco;
SCENARIO( "functions" ) {

std::string string = " a\t\n\r\n\f";
string += char{ std::char_traits<char>::eof() };
auto iter = string.begin();
unsigned int position = 0;

Expand All @@ -24,7 +23,6 @@ SCENARIO( "functions" ) {
CHECK( false == isSpace( iter ) ); ++iter;
CHECK( false == isSpace( iter ) ); ++iter;
CHECK( false == isSpace( iter ) ); ++iter;
CHECK( false == isSpace( iter ) ); ++iter;
CHECK( iter == string.end() );

iter = string.begin();
Expand All @@ -35,7 +33,6 @@ SCENARIO( "functions" ) {
CHECK( false == isSpaceOrTabulation( iter ) ); ++iter;
CHECK( false == isSpaceOrTabulation( iter ) ); ++iter;
CHECK( false == isSpaceOrTabulation( iter ) ); ++iter;
CHECK( false == isSpaceOrTabulation( iter ) ); ++iter;
CHECK( iter == string.end() );

iter = string.begin();
Expand All @@ -46,7 +43,6 @@ SCENARIO( "functions" ) {
CHECK( true == isWhiteSpace( iter ) ); ++iter;
CHECK( true == isWhiteSpace( iter ) ); ++iter;
CHECK( true == isWhiteSpace( iter ) ); ++iter;
CHECK( false == isWhiteSpace( iter ) ); ++iter;
CHECK( iter == string.end() );

iter = string.begin();
Expand All @@ -61,17 +57,5 @@ SCENARIO( "functions" ) {
CHECK( iter == string.begin() + 5 ); ++iter;
// \f is a newline
CHECK( true == isNewLine( iter ) ); ++iter;
CHECK( false == isNewLine( iter ) ); ++iter;
CHECK( iter == string.end() );

iter = string.begin();
CHECK( false == isEndOfFile( iter ) ); ++iter;
CHECK( false == isEndOfFile( iter ) ); ++iter;
CHECK( false == isEndOfFile( iter ) ); ++iter;
CHECK( false == isEndOfFile( iter ) ); ++iter;
CHECK( false == isEndOfFile( iter ) ); ++iter;
CHECK( false == isEndOfFile( iter ) ); ++iter;
CHECK( false == isEndOfFile( iter ) ); ++iter;
CHECK( true == isEndOfFile( iter ) ); ++iter;
CHECK( iter == string.end() );
} // SCENARIO

0 comments on commit 2562272

Please sign in to comment.