test-raw: Run tests and shutdown automatically

* Move running the tests to user bootscript.
* Remove SSH preconfiguration from first_login.
* Add debug_server settings.
* Disable more flaky tests.
* Fix libsupportkit_RemoteTestObject.so build.

Change-Id: I774ab4fc5a007da463cf1213d92132ad9f64fe7f
Reviewed-on: https://review.haiku-os.org/c/haiku/+/10708
Tested-by: Commit checker robot <[email protected]>
Reviewed-by: Kacper Kasper <[email protected]>
This commit is contained in:
Kacper Kasper
2026-04-19 07:26:48 +00:00
parent 82a8edc100
commit 4de63671bd
9 changed files with 32 additions and 16 deletions
+3 -1
View File
@@ -17,6 +17,8 @@ rule UnitTestLib
local local_libraries = $(4) ; local local_libraries = $(4) ;
local rdefs = $(5) ; local rdefs = $(5) ;
AddResources $(lib) : $(rdefs) ;
# if TEST_DEBUG is defined, we turn on debugging # if TEST_DEBUG is defined, we turn on debugging
if $(TEST_DEBUG) { if $(TEST_DEBUG) {
DEBUG on $(lib) [ FGristFiles $(sources:S=$(SUFOBJ)) ] ?= 1 ; DEBUG on $(lib) [ FGristFiles $(sources:S=$(SUFOBJ)) ] ?= 1 ;
@@ -36,7 +38,7 @@ rule UnitTestLib
UseCppUnitObjectHeaders $(sources) ; UseCppUnitObjectHeaders $(sources) ;
MakeLocate $(lib) : $(TARGET_UNIT_TEST_LIB_DIR) ; MakeLocate $(lib) : $(TARGET_UNIT_TEST_LIB_DIR) ;
SharedLibrary $(lib) : $(sources) : $(libraries) $(local_libraries) libcppunit.so : $(rdefs) ; SharedLibrary $(lib) : $(sources) : $(libraries) $(local_libraries) libcppunit.so ;
UnitTestDependency $(lib) ; UnitTestDependency $(lib) ;
UNIT_TEST_LIBRARIES on unittests += $(lib) ; UNIT_TEST_LIBRARIES on unittests += $(lib) ;
+8
View File
@@ -3,6 +3,14 @@
# import everything from the minimum image # import everything from the minimum image
include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions minimum ] ; include [ FDirName $(HAIKU_BUILD_RULES_DIR) images definitions minimum ] ;
local runTestsBootscript = TestsBootscript ;
SEARCH on $(runTestsBootscript) = [ FDirName $(HAIKU_TOP) src tests ] ;
AddFilesToHaikuImage home config settings boot launch : $(runTestsBootscript) ;
local debugServerSettings = debug_server_settings ;
SEARCH on $(debugServerSettings) = [ FDirName $(HAIKU_TOP) src tests ] ;
AddFilesToHaikuImage home config settings system debug_server : $(debugServerSettings) : settings ;
SYSTEM_APPS = [ FFilterByBuildFeatures SYSTEM_APPS = [ FFilterByBuildFeatures
Debugger@libedit Debugger@libedit
NetworkStatus NetworkStatus
-3
View File
@@ -266,9 +266,6 @@ AddFilesToPackage data user_launch : $(userLaunchScripts) ;
# first login scripts # first login scripts
local firstLoginFiles = default_deskbar_items.sh ; local firstLoginFiles = default_deskbar_items.sh ;
if $(HAIKU_BUILD_TYPE) = test {
firstLoginFiles += test_image.sh ;
}
firstLoginFiles = $(firstLoginFiles:G=first-login) ; firstLoginFiles = $(firstLoginFiles:G=first-login) ;
SEARCH on $(firstLoginFiles) SEARCH on $(firstLoginFiles)
= [ FDirName $(HAIKU_TOP) data system boot first_login ] ; = [ FDirName $(HAIKU_TOP) data system boot first_login ] ;
@@ -1,8 +0,0 @@
#!/bin/sh
sshd_config_path=/system/settings/ssh/sshd_config
/bin/sed -i 's/#PasswordAuthentication yes/PasswordAuthentication yes/;' $sshd_config_path
/bin/sed -i 's/#PermitRootLogin prohibit-password/PermitRootLogin yes/;' $sshd_config_path
/bin/sed -i 's/#PermitEmptyPasswords no/PermitEmptyPasswords yes/' $sshd_config_path
/bin/passwd -d user
/bin/sshd -D & # sshd fails to start on first boot
+15
View File
@@ -0,0 +1,15 @@
#!/bin/sh
volumeName="qemu vvfat"
/bin/mountvolume -alldos
cp -r /system/add-ons/unittests /boot/home
(cd /boot/home/unittests && UnitTester) > /"$volumeName"/test_result.txt 2>&1
sleep 5 # in case there is a crash and report has to be written
cp /boot/home/Desktop/*.report /"$volumeName"/
sync
sleep 5
shutdown
+1
View File
@@ -0,0 +1 @@
default_action log
+2 -2
View File
@@ -19,7 +19,7 @@ BTestSuite* getTestSuite2() {
BTestSuite *suite = new BTestSuite("App"); BTestSuite *suite = new BTestSuite("App");
// ##### Add test suites here ##### // ##### Add test suites here #####
suite->addTest("BApplication", ApplicationTestSuite()); // suite->addTest("BApplication", ApplicationTestSuite());
suite->addTest("BClipboard", ClipboardTestSuite()); suite->addTest("BClipboard", ClipboardTestSuite());
// suite->addTest("BCursor", CursorTestSuite()); // suite->addTest("BCursor", CursorTestSuite());
suite->addTest("BHandler", HandlerTestSuite()); suite->addTest("BHandler", HandlerTestSuite());
@@ -29,7 +29,7 @@ BTestSuite* getTestSuite2() {
suite->addTest("BMessageRunner", MessageRunnerTestSuite()); suite->addTest("BMessageRunner", MessageRunnerTestSuite());
suite->addTest("BMessenger", MessengerTestSuite()); suite->addTest("BMessenger", MessengerTestSuite());
suite->addTest("BPropertyInfo", PropertyInfoTestSuite()); suite->addTest("BPropertyInfo", PropertyInfoTestSuite());
suite->addTest("BRoster", RosterTestSuite()); // suite->addTest("BRoster", RosterTestSuite());
// TODO: calls Lock on destruction, hangs // TODO: calls Lock on destruction, hangs
//suite->addTest("RegistrarThreadManager", RegistrarThreadManagerTest::Suite()); //suite->addTest("RegistrarThreadManager", RegistrarThreadManagerTest::Suite());
@@ -44,6 +44,7 @@ rule CopyBAppTestApp
MimeSet $(target) ; MimeSet $(target) ;
UnitTestDependency $(target) ; UnitTestDependency $(target) ;
UNIT_TEST_EXECUTABLES on unittests += $(target) ;
} }
# BApplication::BApplication() test apps # BApplication::BApplication() test apps
@@ -39,8 +39,8 @@
BTestSuite* getTestSuite() { BTestSuite* getTestSuite() {
BTestSuite *suite = new BTestSuite("Translation"); BTestSuite *suite = new BTestSuite("Translation");
suite->addTest("TranslatorRosterTest", TranslatorRosterTest::Suite()); // suite->addTest("TranslatorRosterTest", TranslatorRosterTest::Suite());
suite->addTest("BitmapStreamTest", BitmapStreamTest::Suite()); // suite->addTest("BitmapStreamTest", BitmapStreamTest::Suite());
suite->addTest("TranslationUtilsTest", TranslationUtilsTest::Suite()); suite->addTest("TranslationUtilsTest", TranslationUtilsTest::Suite());
suite->addTest("TranslatorTest", TranslatorTest::Suite()); suite->addTest("TranslatorTest", TranslatorTest::Suite());
return suite; return suite;