Skip to content

Commit

Permalink
mv unit tests directories to test/UnitTests
Browse files Browse the repository at this point in the history
  • Loading branch information
bruno-at-orange committed Mar 18, 2024
1 parent e6ded73 commit 8291dee
Show file tree
Hide file tree
Showing 51 changed files with 40 additions and 40 deletions.
28 changes: 14 additions & 14 deletions .github/workflows/run-unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ on:
- src/**.inc
- src/**.lex
- src/**.yac
- test/**.h
- test/**.cpp
- test/UnitTests/**.h
- test/UnitTests/**.cpp
# Cancel any ongoing run of this workflow on the same PR or ref
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref
Expand Down Expand Up @@ -78,12 +78,12 @@ jobs:
if: success() || failure()
run: |
if (grep -q -E -r "Assert failed in file|Require failed in file|Ensure failed in file|Check failed in file" \
test/KNITest/results/ \
test/Norm/results/ \
test/Learning/results/ \
test/Norm/results/ \
test/Parallel/results/ \
test/Parallel-mpi/results/); then
test/UnitTests/KNItestresults/ \
test/UnitTests/Norm/results/ \
test/UnitTests/Learning/results/ \
test/UnitTests/Norm/results/ \
test/UnitTests/Parallel/results/ \
test/UnitTests/Parallel-mpi/results/); then
echo "::error::At least one test binary has failed with an assertion (assert, check, require, ensure..). Check result files available for download as artifacts."
fi
- name: Upload test results
Expand All @@ -93,12 +93,12 @@ jobs:
name: unit-tests-results-${{ matrix.build-setup.os }}
retention-days: 7
path: |-
test/KNITest/results/
test/Norm/results/
test/Learning/results/
test/Norm/results/
test/Parallel/results/
test/Parallel-mpi/results/
test/UnitTests/KNItest/results/
test/UnitTests/Norm/results/
test/UnitTests/Learning/results/
test/UnitTests/Norm/results/
test/UnitTests/Parallel/results/
test/UnitTests/Parallel-mpi/results/
- name: Create Unit Test Reports Dashboards
uses: phoenix-actions/test-reporting@v12
if: success() || failure()
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ build/
CMakeFiles/

# Test exceptions
test/*/results/
test/UnitTests/*/results/
test/LearningTest/*/*/*/results/
comparisonResults.log

Expand Down
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -343,12 +343,12 @@ if(TESTING)
enable_testing()

# Add testing targets
add_subdirectory(test/Norm)
add_subdirectory(test/Parallel)
add_subdirectory(test/Parallel-mpi)
add_subdirectory(test/Learning)
add_subdirectory(test/KNITest)
add_subdirectory(test/Utils)
add_subdirectory(test/UnitTests/Norm)
add_subdirectory(test/UnitTests/Parallel)
add_subdirectory(test/UnitTests/Parallel-mpi)
add_subdirectory(test/UnitTests/Learning)
add_subdirectory(test/UnitTests/KNITest)
add_subdirectory(test/UnitTests/Utils)
endif(TESTING)

# Exclude googletest from the installation
Expand Down
5 changes: 0 additions & 5 deletions test/KNITest/results.ref/KNI_Adult.txt

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

#include "KNITest.h"
#include "TestServices.h"
#include "../../src/Learning/KNITransfer/KNIRecodeFile.cpp"
#include "../../../src/Learning/KNITransfer/KNIRecodeFile.cpp"

#define MAXITER 1000
#define MAXBUFFERSIZE 1000
Expand Down Expand Up @@ -199,7 +199,7 @@ void TestIris()

sTestPath = FileService::GetPathName(__FILE__);
sDictionaryPath = FileService::BuildFilePathName(sTestPath, "ModelingIris.kdic");
sDataPath = FileService::BuildFilePathName(sTestPath, "../LearningTest/datasets/Iris/Iris.txt");
sDataPath = FileService::BuildFilePathName(sTestPath, "../../LearningTest/datasets/Iris/Iris.txt");
sOutputPath = sTestPath + "results" + FileService::GetFileSeparator() + "R_Iris.txt";
sRefFilePath = sTestPath + "results.ref" + FileService::GetFileSeparator() + "R_Iris.txt";

Expand Down Expand Up @@ -232,8 +232,8 @@ void TestAdult()
boolean bOk;

sTestPath = FileService::GetPathName(__FILE__);
sDictionaryPath = FileService::BuildFilePathName(sTestPath, "../LearningTest/datasets/Adult/Adult.kdic");
sDataPath = FileService::BuildFilePathName(sTestPath, "../LearningTest/datasets/Adult/Adult.txt");
sDictionaryPath = FileService::BuildFilePathName(sTestPath, "../../LearningTest/datasets/Adult/Adult.kdic");
sDataPath = FileService::BuildFilePathName(sTestPath, "../../LearningTest/datasets/Adult/Adult.txt");
sOutputPath = sTestPath + "results" + FileService::GetFileSeparator() + "R_Adult.txt";

// Test de deploiement
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@
#include <string.h>

#include "KhiopsNativeInterface.h"
#include "../../src/Learning/KNITransfer/KNIRecodeFile.h"
#include "../../../src/Learning/KNITransfer/KNIRecodeFile.h"
File renamed without changes.
5 changes: 5 additions & 0 deletions test/UnitTests/KNITest/results.ref/KNI_Adult.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@

Recode records of @ROOT_DIR@/UnitTests/KNITest/../../LearningTest/datasets/Adult/Adult.txt to @ROOT_DIR@/UnitTests/KNITest/results/R_Adult.txt
Recoded record number: 48842

End test Adult
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Begin test KNI
SYS KNI version: 110
SYS KNI full version: 10.1.5
Open stream @ROOT_DIR@/test/KNITest/ModelingIris.kdic SNB_Iris: 1
Open stream @ROOT_DIR@/UnitTests/KNITest/ModelingIris.kdic SNB_Iris: 1
Recode stream record Iris-setosa Iris-setosa 0.9960418693 0.001979090503 0.001979040221: 0
Recode stream record Iris-virginica Iris-virginica 0.00198971666 0.03512915094 0.9628811324: 0
Recode invalid stream record : -14
Expand All @@ -14,12 +14,12 @@ Recode stream record with negative output size : -15
Wrong parameter tests
Open stream with NULL dictionary file NULL SNB_Iris: -2
Open stream with missing dictionary file WrongFile SNB_Iris: -3
Open stream with invalid dictionary file @ROOT_DIR@/test/KNITest/../LearningTest/datasets/Iris/Iris.txt SNB_Iris: -4
Open stream with NULL dictionary @ROOT_DIR@/test/KNITest/ModelingIris.kdic NULL: -5
Open stream with missing dictionary @ROOT_DIR@/test/KNITest/ModelingIris.kdic WrongDic: -6
Open stream with NULL header line @ROOT_DIR@/test/KNITest/ModelingIris.kdic SNB_Iris: -8
Open stream with bad header line @ROOT_DIR@/test/KNITest/ModelingIris.kdic SNB_Iris: -23
Open stream with eol separator @ROOT_DIR@/test/KNITest/ModelingIris.kdic SNB_Iris: -9
Open stream with invalid dictionary file @ROOT_DIR@/UnitTests/KNITest/../../LearningTest/datasets/Iris/Iris.txt SNB_Iris: -4
Open stream with NULL dictionary @ROOT_DIR@/UnitTests/KNITest/ModelingIris.kdic NULL: -5
Open stream with missing dictionary @ROOT_DIR@/UnitTests/KNITest/ModelingIris.kdic WrongDic: -6
Open stream with NULL header line @ROOT_DIR@/UnitTests/KNITest/ModelingIris.kdic SNB_Iris: -8
Open stream with bad header line @ROOT_DIR@/UnitTests/KNITest/ModelingIris.kdic SNB_Iris: -23
Open stream with eol separator @ROOT_DIR@/UnitTests/KNITest/ModelingIris.kdic SNB_Iris: -9
Recode with wrong stream : -10
Close wrong stream (-1): -10
Close wrong stream (0): -10
Expand All @@ -30,7 +30,7 @@ SYS => stream index 317
=> Error -22
Muliple close stream

Recode records of @ROOT_DIR@/test/KNITest/../LearningTest/datasets/Iris/Iris.txt to @ROOT_DIR@/test/KNITest/results/R_Iris.txt
Recode records of @ROOT_DIR@/UnitTests/KNITest/../../LearningTest/datasets/Iris/Iris.txt to @ROOT_DIR@/UnitTests/KNITest/results/R_Iris.txt
Recoded record number: 150

End test KNI
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
// Pour que le test soit valide sur differentes machines, il faut si necessaire remplacer
// dans le fichier de reference les chemins propres à l'environnement par des tags, a savoir :
// - le repertoire temporaire par @TMP_DIR@
// - le repertoire qui contient le projet khiops par @ROOT_DIR@
// - le repertoire qui contient le projet des tests unitaires par @ROOT_DIR@
// Cela concerne essentiellement les tests impliquant des fichiers temporaires.
//
// Le test est reussi lorsque les 2 fichiers sont identiques (a l'exception des
Expand Down

0 comments on commit 8291dee

Please sign in to comment.