restored passing of working directory

This commit is contained in:
joaquintides
2023-08-17 10:21:54 +02:00
parent 3968ff0567
commit aec9c48cf4
2 changed files with 17 additions and 4 deletions
+14 -3
View File
@@ -105,6 +105,9 @@ namespace {
}
}
// used by legacy_serialization_test, passed as argv[1]
const char* test_dir=".";
using test::default_generator;
std::pair<
@@ -175,8 +178,8 @@ namespace {
for(int i = 0; i < sizeof(sizes)/sizeof(sizes[0]); ++i) {
char filename[1024];
std::sprintf(
filename, "./legacy_archives/%s_%d.%s",
lc.second, (int)sizes[i], la.second);
filename, "%s/legacy_archives/%s_%d.%s",
test_dir, lc.second, (int)sizes[i], la.second);
std::ifstream ifs(filename);
Archive ia(ifs);
Container c;
@@ -215,4 +218,12 @@ namespace {
#endif
}
RUN_TESTS()
int main(int argc, char* argv[])
{
if (argc > 1) test_dir = argv[1];
BOOST_UNORDERED_TEST_COMPILER_INFO()
::test::get_state().run_tests();
return boost::report_errors();
}