Changeset: abfe0436c151 for MonetDB URL: https://dev.monetdb.org/hg/MonetDB/rev/abfe0436c151 Added Files: testing/listexports.py Removed Files: testing/listexports.py.in Modified Files: testing/CMakeLists.txt Branch: Aug2024 Log Message:
Use environment variable TSTSRCBASE to find source directory. diffs (59 lines): diff --git a/testing/CMakeLists.txt b/testing/CMakeLists.txt --- a/testing/CMakeLists.txt +++ b/testing/CMakeLists.txt @@ -115,10 +115,6 @@ configure_file(Mconvert.py.in ${CMAKE_CURRENT_BINARY_DIR}/Mconvert.py @ONLY) -configure_file(listexports.py.in - ${CMAKE_CURRENT_BINARY_DIR}/listexports.py - @ONLY) - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/Mtest.py PERMISSIONS ${PROGRAM_PERMISSIONS_DEFAULT} @@ -136,7 +132,7 @@ if(PYTHON3_LIBDIR) install(FILES process.py __init__.py - ${CMAKE_CURRENT_BINARY_DIR}/listexports.py + listexports.py exportutils.py melcheck.py sqllogictest.py diff --git a/testing/listexports.py.in b/testing/listexports.py rename from testing/listexports.py.in rename to testing/listexports.py --- a/testing/listexports.py.in +++ b/testing/listexports.py @@ -32,7 +32,11 @@ skipdirs = ['extras'] skipfiles = ['monet_getopt.h'] # where the files are -srcdir = r'@SOURCE@' +srcdir = os.environ.get('TSTSRCBASE') +if not srcdir: + print('cannot find source directory (TSTSRCBASE environment variable)', + file=sys.stderr) + sys.exit(1) # the export command; note the keyword we look for is a word that ends # in "export" @@ -71,7 +75,7 @@ def mywalk(d): return [(root, [], [file])] return os.walk(d) -def findfiles(dirlist, skipfiles = [], skipdirs = []): +def findfiles(dirlist, skipfiles=[], skipdirs=[]): decls = [] done = {} for d in dirlist: @@ -95,7 +99,7 @@ def listexports(): for lib in libs: dirs = dirlist[lib] dl = [os.path.join(srcdir, d) for d in dirs] - decls = findfiles(dl, skipfiles = skipfiles, skipdirs = skipdirs) + decls = findfiles(dl, skipfiles=skipfiles, skipdirs=skipdirs) output.append(f'# {lib}\n') for d in decls: output.append(d + '\n') _______________________________________________ checkin-list mailing list -- checkin-list@monetdb.org To unsubscribe send an email to checkin-list-le...@monetdb.org