dart-sdk/runtime/bin/test_utils.cc
Ryan Macnak 3c298dbca5 [vm] Update to constexpr in runtime/bin.
TEST=build
Change-Id: I18fc7cfe725dc978d4b23de6191e455ac7cd75e5
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/293800
Reviewed-by: Siva Annamalai <asiva@google.com>
Commit-Queue: Ryan Macnak <rmacnak@google.com>
2023-04-12 20:32:29 +00:00

24 lines
587 B
C++

// Copyright (c) 2022, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
#include "bin/test_utils.h"
#include "bin/file.h"
namespace dart {
namespace bin {
namespace test {
const char* GetFileName(const char* name) {
if (bin::File::Exists(nullptr, name)) {
return name;
} else {
const int kRuntimeLength = strlen("runtime/");
return name + kRuntimeLength;
}
}
} // namespace test
} // namespace bin
} // namespace dart