mirror of
https://github.com/anrieff/libcpuid
synced 2025-10-03 11:01:30 +00:00
Fix 'make test' failing without any really wrong tests.
The reason was that the invocation of the cpuid_tool through the makefile was using LD_LIBRARY_PATH=. to force link&use of the latest-build libcpuid library. This doesn't seem to work, so using LD_PRELOAD to explicitly load libcpuid.so into cpuid_tool. The committed approach of course doesn't work on Mac OS X, where make test-old should be used.
This commit is contained in:
parent
281d4720d4
commit
13f382725b
2 changed files with 11 additions and 2 deletions
|
@ -15,7 +15,7 @@ consistency:
|
||||||
test: test-fast
|
test: test-fast
|
||||||
|
|
||||||
test-fast:
|
test-fast:
|
||||||
LD_LIBRARY_PATH=$(top_builddir)/libcpuid/.libs $(top_srcdir)/tests/run_tests.py $(top_builddir)/cpuid_tool/.libs/cpuid_tool $(top_srcdir)/tests
|
LD_PRELOAD=$(top_builddir)/libcpuid/.libs/libcpuid.so $(top_srcdir)/tests/run_tests.py $(top_builddir)/cpuid_tool/.libs/cpuid_tool --show-test-fast-warning $(top_srcdir)/tests
|
||||||
|
|
||||||
test-old:
|
test-old:
|
||||||
$(top_srcdir)/tests/run_tests.py $(top_builddir)/cpuid_tool/cpuid_tool $(top_srcdir)/tests
|
$(top_srcdir)/tests/run_tests.py $(top_builddir)/cpuid_tool/cpuid_tool $(top_srcdir)/tests
|
||||||
|
|
|
@ -12,6 +12,7 @@ fields = [ "family", "model", "stepping", "extfamily", "extmodel", "cores",
|
||||||
|
|
||||||
args = sys.argv
|
args = sys.argv
|
||||||
fix = False
|
fix = False
|
||||||
|
show_test_fast_warning = False
|
||||||
|
|
||||||
if len(args) < 3:
|
if len(args) < 3:
|
||||||
print """
|
print """
|
||||||
|
@ -31,6 +32,9 @@ for arg in args[2:]:
|
||||||
if arg == "--fix":
|
if arg == "--fix":
|
||||||
fix = True
|
fix = True
|
||||||
continue
|
continue
|
||||||
|
if arg == "--show-test-fast-warning":
|
||||||
|
show_test_fast_warning = True
|
||||||
|
continue
|
||||||
if os.path.isdir(arg):
|
if os.path.isdir(arg):
|
||||||
# gather all *.test files from subdirs amd and intel:
|
# gather all *.test files from subdirs amd and intel:
|
||||||
for dirpath, dirnames, filenames in os.walk(arg):
|
for dirpath, dirnames, filenames in os.walk(arg):
|
||||||
|
@ -120,5 +124,10 @@ for test_file_name in filelist:
|
||||||
errors = True
|
errors = True
|
||||||
build_output = False
|
build_output = False
|
||||||
|
|
||||||
if not errors:
|
if errors:
|
||||||
|
if show_test_fast_warning:
|
||||||
|
print """
|
||||||
|
You're running tests in fast mode; before taking any action on the errors
|
||||||
|
above, please confirm that the slow mode ('make test-old') also fails."""
|
||||||
|
else:
|
||||||
print "All successfull!"
|
print "All successfull!"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue