Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail test #41

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 66 additions & 8 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,25 +22,83 @@ jobs:
msbuild /p:Configuration=Release /p:Platform=x86
msbuild /p:Configuration=Release /p:Platform=x64
cd Tests
Get-ChildItem -Path *.vcxproj | ForEach-Object {& msbuild /p:Configuration=Release /p:Platform=x86 $_.FullName}
Get-ChildItem -Path *.vcxproj | ForEach-Object {& msbuild /p:Configuration=Release /p:Platform=x64 $_.FullName}

$x86ExitCodes = Get-ChildItem -Path *.vcxproj | ForEach-Object {
& msbuild /p:Configuration=Release /p:Platform=x86 $_.FullName
$LASTEXITCODE
}

$x64ExitCodes = Get-ChildItem -Path *.vcxproj | ForEach-Object {
& msbuild /p:Configuration=Release /p:Platform=x64 $_.FullName
$LASTEXITCODE
}

if ($x86ExitCodes -contains 1 -or $x64ExitCodes -contains 1) {
Write-Host "Building Release build of tests failed."
exit 1
}
- name: Build Debug
run: |
msbuild /p:Configuration=Debug /p:Platform=x86
msbuild /p:Configuration=Debug /p:Platform=x64
cd Tests
Get-ChildItem -Path *.vcxproj | ForEach-Object {& msbuild /p:Configuration=Debug /p:Platform=x86 $_.FullName}
Get-ChildItem -Path *.vcxproj | ForEach-Object {& msbuild /p:Configuration=Debug /p:Platform=x64 $_.FullName}

$x86ExitCodes = Get-ChildItem -Path *.vcxproj | ForEach-Object {
& msbuild /p:Configuration=Debug /p:Platform=x86 $_.FullName
$LASTEXITCODE
}

$x64ExitCodes = Get-ChildItem -Path *.vcxproj | ForEach-Object {
& msbuild /p:Configuration=Debug /p:Platform=x64 $_.FullName
$LASTEXITCODE
}

if ($x86ExitCodes -contains 1 -or $x64ExitCodes -contains 1) {
Write-Host "Building Debug build of tests failed."
exit 1
}
- name: Test
run: |
cd Tests
Get-ChildItem -Path Win32\Release\*.exe | ForEach-Object {& $_.FullName}
Get-ChildItem -Path x64\Release\*.exe | ForEach-Object {& $_.FullName}

Get-ChildItem -Path Win32\Release\*.exe | ForEach-Object {
& $_.FullName

if ($LASTEXITCODE -ne 0) {
Write-Host "Executing Release build of x86 tests failed."
exit 1
}
}

Get-ChildItem -Path x64\Release\*.exe | ForEach-Object {
& $_.FullName

if ($LASTEXITCODE -ne 0) {
Write-Host "Executing Release build of x64 tests failed."
exit 1
}
}
- name: Test Debug
run: |
cd Tests
Get-ChildItem -Path Win32\Debug\*.exe | ForEach-Object {& $_.FullName}
Get-ChildItem -Path x64\Debug\*.exe | ForEach-Object {& $_.FullName}

Get-ChildItem -Path Win32\Debug\*.exe | ForEach-Object {
& $_.FullName

if ($LASTEXITCODE -ne 0) {
Write-Host "Executing Debug build of x86 tests failed."
exit 1
}
}

Get-ChildItem -Path x64\Debug\*.exe | ForEach-Object {
& $_.FullName

if ($LASTEXITCODE -ne 0) {
Write-Host "Executing Debug build of x64 tests failed."
exit 1
}
}
- name: Archive Libraries
uses: actions/upload-artifact@v3
with:
Expand Down
4 changes: 2 additions & 2 deletions Tests/SomeDir/SomeFile.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Do not edit the contents of this file! It is used by the T_Dir test case and
must contain precisely this test, with UNIX line endings, and must be precisely
174 bytes long.
must contain precisely this text, with UNIX or DOS line endings as appropriate,
and must be precisely 236 or 239 bytes long for UNIX or Windows respectively.
24 changes: 17 additions & 7 deletions Tests/T_Dir.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@
#include <Test.h>
#include <string.h>

#ifdef _WIN32

#define SOME_FILE_SIZE 239

#else /* ! _WIN32 */

#define SOME_FILE_SIZE 236

#endif /* ! _WIN32 */

static RDir g_oDir; /* RDir class is global to implicitly test re-use */
static RFileUtils g_oFileUtils; /* Class for cleaning up the file system */
static RTest Test("T_Dir"); /* Class to use for testing and reporting results */
Expand Down Expand Up @@ -81,8 +91,8 @@ int main()
/* Test #3: Test that open() with a directory path works */

Test.Next("Test that open() with a directory path works");
TestScan("SomeDir", 1, 174);
TestScan("SomeDir/", 1, 174);
TestScan("SomeDir", 1, SOME_FILE_SIZE);
TestScan("SomeDir/", 1, SOME_FILE_SIZE);

/* Test #4: Test that open() with wildcards works */

Expand All @@ -92,21 +102,21 @@ int main()

TestScan("#?");
TestScan("#?.sln", 1, 10393);
TestScan("SomeDir/#?.txt", 1, 174);
TestScan("SomeDir/#?.txt", 1, SOME_FILE_SIZE);

#else /* ! __amigaos__ */

TestScan("*");
TestScan("*.sln", 1, 10393);
TestScan("SomeDir/*.txt", 1, 174);
TestScan("SomeDir/*.txt", 1, SOME_FILE_SIZE);

#endif /* ! __amigaos__ */

/* Test #5: Test that open() with a filename works */

Test.Next("Test that open() with a filename works");
TestScan("T_Dir.cpp");
TestScan("SomeDir/SomeFile.txt", 1, 174);
TestScan("SomeDir/SomeFile.txt", 1, SOME_FILE_SIZE);

/* Test #6: Test that open() with an invalid path works */

Expand Down Expand Up @@ -198,8 +208,8 @@ int main()

Test.Next("Test some paths that only work on Windows and UNIX");
TestScan(".");
TestScan("../Tests/SomeDir", 1, 174);
TestScan("../Tests/SomeDir/", 1, 174);
TestScan("../Tests/SomeDir", 1, SOME_FILE_SIZE);
TestScan("../Tests/SomeDir/", 1, SOME_FILE_SIZE);

#endif /* ! __amigaos__ */

Expand Down
Loading