Skip to content

Commit

Permalink
[test] Split out Ninja and Ninja Multi-Config for artifacts_path test
Browse files Browse the repository at this point in the history
  • Loading branch information
zchrissirhcz committed Nov 20, 2024
1 parent 9fdb12b commit a451c00
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ def check_build(self, project_name, args=''):

def test_artifact_path(self):
if PLATFORM.startswith('vs'):
out = self.check_generate('artifacts_path', args='-G Ninja -DCMAKE_TOOLCHAIN_FILE="../../toolchains/Windows.MSVC.toolchain.cmake"')
# Ninja Multi-Config
out = self.check_generate('artifacts_path', args='-G "Ninja Multi-Config" -DCMAKE_TOOLCHAIN_FILE="../../toolchains/Windows.MSVC.toolchain.cmake"')
print(out)
out = self.check_build('artifacts_path', '--config Release')
print(out)
Expand All @@ -61,6 +62,19 @@ def test_artifact_path(self):
self.assertTrue(os.path.exists('build/artifacts_path/Release/subfoo_static.lib'))
self.assertTrue(os.path.exists('build/artifacts_path/Release/subfoo_shared.dll'))
self.assertTrue(os.path.exists('build/artifacts_path/Release/subhello.exe'))
shutil.rmtree('build/artifacts_path')

# Ninja
out = self.check_generate('artifacts_path', args='-G Ninja -DCMAKE_TOOLCHAIN_FILE="../../toolchains/Windows.MSVC.toolchain.cmake"')
print(out)
out = self.check_build('artifacts_path', '--config Release')
print(out)
self.assertTrue(os.path.exists('build/artifacts_path/foo_static.lib'))
self.assertTrue(os.path.exists('build/artifacts_path/foo_shared.dll'))
self.assertTrue(os.path.exists('build/artifacts_path/hello.exe'))
self.assertTrue(os.path.exists('build/artifacts_path/subfoo_static.lib'))
self.assertTrue(os.path.exists('build/artifacts_path/subfoo_shared.dll'))
self.assertTrue(os.path.exists('build/artifacts_path/subhello.exe'))
elif PLATFORM == 'linux':
self.check_generate('artifacts_path')
self.check_build('artifacts_path')
Expand Down

0 comments on commit a451c00

Please sign in to comment.