1 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
2 // -*- Mode: C++ -*-
3 //
4 // Copyright (C) 2013-2020 Red Hat, Inc.
5 
6 #include "test-utils.h"
7 
8 using std::string;
9 
10 namespace abigail
11 {
12 namespace tests
13 {
14 
15 /// Returns the absolute path to the source directory.
16 ///
17 /// \return the absolute path tho the source directory.
18 const char*
get_src_dir()19 get_src_dir()
20 {
21 #ifndef ABIGAIL_SRC_DIR
22 #error the macro ABIGAIL_SRC_DIR must be set at compile time
23 #endif
24 
25   static __thread const char* s(ABIGAIL_SRC_DIR);
26   return s;
27 }
28 
29 /// Returns the absolute path to the build directory.
30 ///
31 /// \return the absolute path the build directory.
32 const char*
get_build_dir()33 get_build_dir()
34 {
35 #ifndef ABIGAIL_BUILD_DIR
36 #error the macro ABIGAIL_BUILD_DIR must be set at compile time
37 #endif
38 
39   static __thread const char* s(ABIGAIL_BUILD_DIR);
40   return s;
41 }
42 
43 }//end namespace tests
44 }//end namespace abigail
45