Skip to content

Commit 4b8ee38

Browse files
committed
Getting this to final, minor tweaks
about getting from github. modified: doc/libdwarf.pdf Now that the leading element of semantic version is 2 (instead of 0) some script elements needed update to pass cmake and meson tests on windows msys2 with shared libraries (dll). modified: test/CMakeLists.txt modified: test/meson.build modified: test/test_dwarfdump.py modified: test/test_dwarfdumpsetup.sh
1 parent 92ece19 commit 4b8ee38

File tree

5 files changed

+23
-10
lines changed

5 files changed

+23
-10
lines changed

doc/libdwarf.pdf

246 Bytes
Binary file not shown.

test/CMakeLists.txt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -333,21 +333,21 @@ if (DO_TESTING AND NOT WIN32)
333333
set(pebasedir "${PROJECT_SOURCE_DIR}")
334334
set(peshdir "${PROJECT_SOURCE_DIR}/test")
335335
set(pebindir "${PROJECT_BINARY_DIR}")
336-
add_test(NAME selfdwarfdumppe COMMAND python3 ${peshdir}/test_dwarfdump.py PE cmake ${pebasedir} ${pebindir})
336+
add_test(NAME selfdwarfdumppe COMMAND python3 ${peshdir}/test_dwarfdump.py PE cmake ${pebasedir} ${pebindir} ${PROJECT_VERSION})
337337
endif()
338338

339339
if (DO_TESTING AND NOT WIN32)
340340
set(elfbasedir "${PROJECT_SOURCE_DIR}")
341341
set(elfshdir "${PROJECT_SOURCE_DIR}/test")
342342
set(elfbindir "${PROJECT_BINARY_DIR}")
343-
add_test(NAME selfdwarfdumpelf COMMAND python3 ${elfshdir}/test_dwarfdump.py Elf cmake ${elfbasedir} ${elfbindir})
343+
add_test(NAME selfdwarfdumpelf COMMAND python3 ${elfshdir}/test_dwarfdump.py Elf cmake ${elfbasedir} ${elfbindir} ${PROJECT_VERSION})
344344
endif()
345345

346346
if (DO_TESTING AND NOT WIN32)
347347
set(macbasedir "${PROJECT_SOURCE_DIR}")
348348
set(macshdir "${PROJECT_SOURCE_DIR}/test")
349349
set(macbindir "${PROJECT_BINARY_DIR}")
350-
add_test(NAME selfdwarfdumpmacho COMMAND python3 ${macshdir}/test_dwarfdump.py Macos cmake ${macbasedir} ${macbindir})
350+
add_test(NAME selfdwarfdumpmacho COMMAND python3 ${macshdir}/test_dwarfdump.py Macos cmake ${macbasedir} ${macbindir} ${PROJECT_VERSION})
351351
endif()
352352

353353
if (DO_TESTING AND BUILD_DWARFEXAMPLE AND NOT WIN32)

test/meson.build

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ foreach atest_src : argstests
129129
test(atest_name,atexec, args: ['-f',projectbase])
130130
endforeach
131131

132+
semantic_ver = meson.project_version()
132133
pyscripttests = [
133134
['Elf'],
134135
['PE',],
@@ -153,9 +154,10 @@ if py3_exe.found()
153154
foreach testscr : pyscripttests
154155
pytest_name = testscr[0]
155156
message(pytest_name)
157+
semanticver = meson.project_version()
156158
buildbase = builddir
157159
pyexec_name = join_paths(projectbase,'test','test_dwarfdump.py')
158-
test(pytest_name,py3_exe, args: [pyexec_name, pytest_name,'meson', projectbase, buildbase])
160+
test(pytest_name,py3_exe, args: [pyexec_name, pytest_name,'meson', projectbase, buildbase, semanticver])
159161
endforeach
160162
endif
161163

test/test_dwarfdump.py

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
# for anyone to used for any purpose.
44
#
55
# Run in test dir as:
6-
# test_dwarfdump.py filetype buildsys sourcedirbase builddirbase
6+
# test_dwarfdump.py filetype buildsys sourcedirbase builddirbase \
7+
# semanticver
78
# where filetype is Elf, PE, or Macos
89
# where buildsys is conf, cmake, or meson
910

@@ -54,14 +55,16 @@ def __init__(self):
5455
self.buildsystem = False
5556
self.srcbase = False
5657
self.bldbase = False
58+
self.semanticver = False
5759
self.cwd = False
5860

5961
def tprint(self):
6062
print("Testdata objtype :", self.objtype)
6163
print("Testdata build system :", self.buildsystem)
6264
print("Testdata source base dir:", self.srcbase)
6365
print("Testdata build base dir :", self.bldbase)
64-
print("Testdata working dir :", self.cwd)
66+
print("Testdata working dir :", self.cwd)
67+
print("Testdata Semantic Ver :", self.semanticver)
6568

6669

6770
def setupfilesinvolved(td, dd):
@@ -169,23 +172,31 @@ def rundwarfdump(td, dd, dwarfdumppath, objpath, lmaxlines):
169172
# we are in windows copy dll from lib build to
170173
# the dwarfdump build directory.
171174
def copydll(td):
175+
semantic = td.semanticver
176+
svlist = semantic.split(".")
177+
dllv = svlist[0]
178+
print("Copy dll semantic:",semantic," Prefixnum",dllv)
179+
dllname=''.join(["libdwarf-",dllv,".dll"])
172180
dllpath = os.path.join(td.bldbase,
173-
"src/lib/libdwarf/libdwarf-0.dll")
181+
"src/lib/libdwarf",dllname)
174182
targetdllpath= os.path.join(td.bldbase,
175-
"src/bin/dwarfdump/libdwarf-0.dll")
183+
"src/bin/dwarfdump",dllname)
184+
print("dllpath",dllpath)
185+
print("targetdllpath",targetdllpath)
176186
if os.path.exists(dllpath):
177187
if not os.path.exists(targetdllpath):
178188
shutil.copy(dllpath,targetdllpath)
179189

180190
if __name__ == "__main__":
181-
if len(sys.argv) != 5:
191+
if len(sys.argv) != 6:
182192
print("FAIL test_dwarfdump.py arg count wrong")
183193
sys.exit(1)
184194
td = tdata()
185195
td.objtype = sys.argv[1]
186196
td.buildsystem = sys.argv[2]
187197
td.srcbase = sys.argv[3]
188198
td.bldbase = sys.argv[4]
199+
td.semanticver = sys.argv[5]
189200
td.cwd = os.getcwd()
190201
print("Running dwarfdump test")
191202
td.tprint()

test/test_dwarfdumpsetup.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ then
2727
top_blddir=`pwd`
2828
echo "For ninja set top blddir $top_blddir"
2929
else
30-
ignore, we leav top_blddir as above.
30+
echo "ignore, we leave top_blddir as above."
3131
fi
3232
fi
3333
else

0 commit comments

Comments
 (0)