Cleanup to get more independent of std (#1139)

* Remove redundant test.sh

* Fix includes according to usage / dependency in individual header files
This commit is contained in:
Roland Reichwein 2025-07-06 21:59:39 +02:00 committed by GitHub
parent 5807337721
commit cb6b384f88
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 7 additions and 180 deletions

View File

@ -45,6 +45,7 @@ SOFTWARE.
#include "smallest.h"
#include "exception.h"
#include "error_handler.h"
#include "functional.h"
#if ETL_USING_CPP20 && ETL_USING_STL
#include <bit>

View File

@ -33,7 +33,6 @@ SOFTWARE.
#include "platform.h"
#include "type_traits.h"
#include "char_traits.h"
#include "integral_limits.h"
#if ETL_NOT_USING_STL && defined(ETL_COMPILER_ARM5) && !defined(__USE_C99_MATH)

View File

@ -33,6 +33,7 @@ SOFTWARE.
#include "platform.h"
#include "ihash.h"
#include "iterator.h"
#include "binary.h"
#include "error_handler.h"

View File

@ -37,6 +37,8 @@ SOFTWARE.
#include "../../limits.h"
#include "../../type_traits.h"
#include <string.h>
namespace etl
{
namespace chrono

View File

@ -32,6 +32,8 @@ SOFTWARE.
#error DO NOT DIRECTLY INCLUDE THIS FILE. USE CHRONO.H
#endif
#include <string.h>
namespace etl
{
namespace chrono

View File

@ -1,179 +0,0 @@
#!/bin/sh
clear
mkdir -p build-make || exit 1
cd build-make || exit 1
echo "ETL Tests" > log.txt
export ASAN_OPTIONS=symbol_line=1
export ASAN_SYMBOLIZER_PATH=/usr/lib/llvm-14/bin//llvm-symbolizer
echo -e
testname="Test Name Not Set"
FailColour='\033[38;2;255;128;128m'
PassColour='\033[38;2;128;255;128m'
TitleColour='\033[38;2;107;210;255m'
HelpColour='\033[38;2;255;128;128m'
NoColour='\033[0m'
SetTestName()
{
testname=$1
}
Bell()
{
echo -n $'\a'
}
PrintHeader()
{
echo "$TitleColour"
echo "============================================================================" | tee -a log.txt
echo " $testname " | tee -a log.txt
echo " Language standard : C++$cxx_standard " | tee -a log.txt
echo " Optimisation : $opt " | tee -a log.txt
echo "============================================================================" | tee -a log.txt
echo "$NoColour"
}
PrintHelp()
{
echo "$HelpColour"
echo "----------------------------------------------------------------------------"
echo " Syntax : ./run-tests.sh <options> "
echo " -c : C++ Standard : 11, 14, 17 or 20 "
echo " -o : Optimisation : 0, 1, 2 or 3. Default = 0 "
echo " -p : Processes : Default = 1 "
echo " -s : Sanitizer : off or on : Default = off "
echo " "
echo " -c option is mandatory. "
echo "----------------------------------------------------------------------------"
echo "$NoColour"
}
PassedCompilation()
{
echo "$PassColour"
echo "-----------------------------------------------" | tee -a log.txt
echo " Passed Compilation - $testname " | tee -a ../log.txt
echo "-----------------------------------------------" | tee -a log.txt
echo "$NoColour"
}
PassedTests()
{
echo "$PassColour"
echo "-----------------------------------------------" | tee -a log.txt
echo " Passed Tests - $testname " | tee -a ../log.txt
echo "-----------------------------------------------" | tee -a log.txt
echo "$NoColour"
}
FailedCompilation()
{
echo "$FailColour"
echo "****************************************************************************" | tee -a log.txt
echo "**** Failed Compilation $testname " | tee -a log.txt
echo "****************************************************************************" | tee -a ../log.txt
echo "$NoColour"
Bell
}
FailedTests()
{
echo "$FailColour"
echo "****************************************************************************" | tee -a log.txt
echo "**** Failed Tests $testname " | tee -a log.txt
echo "****************************************************************************" | tee -a ../log.txt
echo "$NoColour"
Bell
}
TestsCompleted()
{
echo "$PassColour"
echo "-----------------------------------------------" | tee -a log.txt
echo " All Tests Completed OK " | tee -a log.txt
echo "-----------------------------------------------" | tee -a log.txt
echo "$NoColour"
}
#******************************************************************************
# Parse the options.
#******************************************************************************
while getopts ":c:o:p:s:" opt; do
case $opt in
c) c="$OPTARG" ;;
o) o="$OPTARG" ;;
p) p="$OPTARG" ;;
s) s="$OPTARG" ;;
[?]) echo "Invalid option -$OPTARG" >&2
exit 1
;;
esac
done
#******************************************************************************
# Set the language standard.
#******************************************************************************
if [ "$c" = "11" ]; then
cxx_standard="11"
elif [ "$c" = "14" ]; then
cxx_standard="14"
elif [ "$c" = "17" ]; then
cxx_standard="17"
elif [ "$c" = "20" ]; then
cxx_standard="20"
else
PrintHelp
exit
fi
#******************************************************************************
# Set the optimisation level. Default -O0
#******************************************************************************
if [ "$o" = "1" ]; then
opt="-O1"
elif [ "$o" = "2" ]; then
opt="-O2"
elif [ "$o" = "3" ]; then
opt="-O3"
else
opt="-O0"
fi
#******************************************************************************
# Set the number of concurrent processes to use.
#******************************************************************************
if [ "$p" = "" ]; then
export CMAKE_BUILD_PARALLEL_LEVEL=1
processes="1"
else
export CMAKE_BUILD_PARALLEL_LEVEL=$p
processes=$p
fi
echo ""
echo "Using "${CMAKE_BUILD_PARALLEL_LEVEL}" concurrent processes"
#******************************************************************************
# Set the sanitizer enable. Default OFF
#******************************************************************************
if [ "$s" = "on" ]; then
sanitizer="ON"
else
sanitizer="OFF"
fi
echo cxx_standard = $cxx_standard
echo optimisation = $opt
echo processes = $processes
echo sanitizer = $sanitizer
PrintHeader
TestsCompleted

View File

@ -34,6 +34,7 @@ SOFTWARE.
#include <string>
#include <vector>
#include <stdint.h>
#include <string.h>
#include "etl/murmur3.h"