Skip to content

Commit

Permalink
STASH
Browse files Browse the repository at this point in the history
  • Loading branch information
cottsay committed Apr 1, 2024
1 parent c73c86f commit 00d1d2f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Run tests

on: # yamllint disable-line rule:truthy
push:
branches: ['master']
branches: ['master', 'cottsay/ws-test']
pull_request:

jobs:
Expand Down
5 changes: 4 additions & 1 deletion src/catkin_pkg/workspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from __future__ import print_function

import os
import warnings

CATKIN_WORKSPACE_MARKER_FILE = '.catkin_workspace'

Expand Down Expand Up @@ -94,7 +95,9 @@ def order_paths(paths_to_order, prefix_paths):
def _is_equal_or_in_parents(dir_, path):
dir_ = os.path.normcase(os.path.realpath(dir_))
path = os.path.normcase(os.path.realpath(path))
return path == dir_ or path.startswith(dir_ + os.sep)
res = (path == dir_ or path.startswith(dir_ + os.sep))
warnings.warn(f'Checking if {path} is under {dir_}: {res}')
return res


def ensure_workspace_marker(base_path):
Expand Down
6 changes: 5 additions & 1 deletion test/test_workspaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import os
import shutil
import sys
import tempfile
import unittest

Expand Down Expand Up @@ -43,7 +44,10 @@ def test_order_paths(self):
self.assertEqual(['foo' + os.sep + 'bim', 'bar'], order_paths(['bar', 'foo' + os.sep + 'bim'], ['foo']))

def test_order_paths_with_symlink(self):
root_dir = tempfile.mkdtemp()
if os.name == 'nt' and sys.version_info < ('3', '8'):
self.skipTest('symlinks are not resolved on windows prior to Python 3.8')

root_dir = os.path.realpath(tempfile.mkdtemp())
try:
foo = os.path.join(root_dir, 'foo')
foo_inc = os.path.join(foo, 'include')
Expand Down

0 comments on commit 00d1d2f

Please sign in to comment.