@@ -156,8 +156,8 @@ BOOST_AUTO_TEST_CASE(cli_input)
156
156
{(expectedDir2 / " input2.sol" ).generic_string (), " " },
157
157
};
158
158
PathSet expectedAllowedPaths = {
159
- boost::filesystem::canonical (tempDir1. path () ),
160
- boost::filesystem::canonical (tempDir2. path () ),
159
+ boost::filesystem::canonical (tempDir1),
160
+ boost::filesystem::canonical (tempDir2),
161
161
" b/c" ,
162
162
" c/d/e" ,
163
163
};
@@ -191,7 +191,7 @@ BOOST_AUTO_TEST_CASE(cli_ignore_missing_some_files_exist)
191
191
192
192
// NOTE: Allowed paths should not be added for skipped files.
193
193
map<string, string> expectedSources = {{(expectedDir1 / " input1.sol" ).generic_string (), " " }};
194
- PathSet expectedAllowedPaths = {boost::filesystem::canonical (tempDir1. path () )};
194
+ PathSet expectedAllowedPaths = {boost::filesystem::canonical (tempDir1)};
195
195
196
196
OptionsReaderAndMessages result = parseCommandLineAndReadInputFiles ({
197
197
" solc" ,
@@ -354,14 +354,14 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_no_base_path)
354
354
{
355
355
TemporaryDirectory tempDirCurrent (TEST_CASE_NAME);
356
356
TemporaryDirectory tempDirOther (TEST_CASE_NAME);
357
- TemporaryWorkingDirectory tempWorkDir (tempDirCurrent. path () );
357
+ TemporaryWorkingDirectory tempWorkDir (tempDirCurrent);
358
358
soltestAssert (tempDirCurrent.path ().is_absolute (), " " );
359
359
soltestAssert (tempDirOther.path ().is_absolute (), " " );
360
360
361
361
// NOTE: On macOS the path usually contains symlinks which prevents base path from being stripped.
362
362
// Use canonical() to resolve symnlinks and get consistent results on all platforms.
363
- boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent. path () );
364
- boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther. path () );
363
+ boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent);
364
+ boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther);
365
365
366
366
boost::filesystem::path expectedOtherDir = " /" / otherDirNoSymlinks.relative_path ();
367
367
soltestAssert (expectedOtherDir.is_absolute () || expectedOtherDir.root_path () == " /" , " " );
@@ -412,14 +412,14 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_base_path_same_as_work_dir)
412
412
{
413
413
TemporaryDirectory tempDirCurrent (TEST_CASE_NAME);
414
414
TemporaryDirectory tempDirOther (TEST_CASE_NAME);
415
- TemporaryWorkingDirectory tempWorkDir (tempDirCurrent. path () );
415
+ TemporaryWorkingDirectory tempWorkDir (tempDirCurrent);
416
416
soltestAssert (tempDirCurrent.path ().is_absolute (), " " );
417
417
soltestAssert (tempDirOther.path ().is_absolute (), " " );
418
418
419
419
// NOTE: On macOS the path usually contains symlinks which prevents base path from being stripped.
420
420
// Use canonical() to resolve symnlinks and get consistent results on all platforms.
421
- boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent. path () );
422
- boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther. path () );
421
+ boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent);
422
+ boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther);
423
423
424
424
boost::filesystem::path expectedWorkDir = " /" / boost::filesystem::current_path ().relative_path ();
425
425
boost::filesystem::path expectedOtherDir = " /" / otherDirNoSymlinks.relative_path ();
@@ -475,16 +475,16 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_base_path_different_from_wor
475
475
TemporaryDirectory tempDirCurrent (TEST_CASE_NAME);
476
476
TemporaryDirectory tempDirOther (TEST_CASE_NAME);
477
477
TemporaryDirectory tempDirBase (TEST_CASE_NAME);
478
- TemporaryWorkingDirectory tempWorkDir (tempDirCurrent. path () );
478
+ TemporaryWorkingDirectory tempWorkDir (tempDirCurrent);
479
479
soltestAssert (tempDirCurrent.path ().is_absolute (), " " );
480
480
soltestAssert (tempDirOther.path ().is_absolute (), " " );
481
481
soltestAssert (tempDirBase.path ().is_absolute (), " " );
482
482
483
483
// NOTE: On macOS the path usually contains symlinks which prevents base path from being stripped.
484
484
// Use canonical() to resolve symnlinks and get consistent results on all platforms.
485
- boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent. path () );
486
- boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther. path () );
487
- boost::filesystem::path baseDirNoSymlinks = boost::filesystem::canonical (tempDirBase. path () );
485
+ boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent);
486
+ boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther);
487
+ boost::filesystem::path baseDirNoSymlinks = boost::filesystem::canonical (tempDirBase);
488
488
489
489
boost::filesystem::path expectedWorkDir = " /" / boost::filesystem::current_path ().relative_path ();
490
490
boost::filesystem::path expectedCurrentDir = " /" / currentDirNoSymlinks.relative_path ();
@@ -547,14 +547,14 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_relative_base_path)
547
547
{
548
548
TemporaryDirectory tempDirCurrent (TEST_CASE_NAME);
549
549
TemporaryDirectory tempDirOther (TEST_CASE_NAME);
550
- TemporaryWorkingDirectory tempWorkDir (tempDirCurrent. path () );
550
+ TemporaryWorkingDirectory tempWorkDir (tempDirCurrent);
551
551
soltestAssert (tempDirCurrent.path ().is_absolute (), " " );
552
552
soltestAssert (tempDirOther.path ().is_absolute (), " " );
553
553
554
554
// NOTE: On macOS the path usually contains symlinks which prevents base path from being stripped.
555
555
// Use canonical() to resolve symnlinks and get consistent results on all platforms.
556
- boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent. path () );
557
- boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther. path () );
556
+ boost::filesystem::path currentDirNoSymlinks = boost::filesystem::canonical (tempDirCurrent);
557
+ boost::filesystem::path otherDirNoSymlinks = boost::filesystem::canonical (tempDirOther);
558
558
559
559
boost::filesystem::path expectedWorkDir = " /" / boost::filesystem::current_path ().relative_path ();
560
560
boost::filesystem::path expectedOtherDir = " /" / otherDirNoSymlinks.relative_path ();
@@ -622,7 +622,7 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_normalization_and_weird_name
622
622
string uncPath = " //" + tempDir.path ().relative_path ().generic_string ();
623
623
soltestAssert (FileReader::isUNCPath (uncPath), " " );
624
624
625
- boost::filesystem::path tempDirNoSymlinks = boost::filesystem::canonical (tempDir. path () );
625
+ boost::filesystem::path tempDirNoSymlinks = boost::filesystem::canonical (tempDir);
626
626
627
627
boost::filesystem::path expectedWorkDir = " /" / boost::filesystem::current_path ().relative_path ();
628
628
soltestAssert (expectedWorkDir.is_absolute () || expectedWorkDir.root_path () == " /" , " " );
@@ -829,7 +829,7 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_symlinks)
829
829
};
830
830
831
831
FileReader::FileSystemPathSet expectedAllowedDirectories = {
832
- boost::filesystem::canonical (tempDir. path () ) / " x/y/z" ,
832
+ boost::filesystem::canonical (tempDir) / " x/y/z" ,
833
833
};
834
834
835
835
OptionsReaderAndMessages result = parseCommandLineAndReadInputFiles (commandLine);
@@ -846,7 +846,7 @@ BOOST_AUTO_TEST_CASE(cli_paths_to_source_unit_names_symlinks)
846
846
BOOST_AUTO_TEST_CASE (cli_paths_to_source_unit_names_base_path_and_stdin)
847
847
{
848
848
TemporaryDirectory tempDir (TEST_CASE_NAME);
849
- TemporaryWorkingDirectory tempWorkDir (tempDir. path () );
849
+ TemporaryWorkingDirectory tempWorkDir (tempDir);
850
850
boost::filesystem::create_directories (tempDir.path () / " base" );
851
851
852
852
boost::filesystem::path expectedWorkDir = " /" / boost::filesystem::current_path ().relative_path ();
0 commit comments