Skip to content

Commit

Permalink
Merge branch 'intel:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
xandr244 committed Aug 31, 2024
2 parents ef4cfee + 4c524a1 commit cb8f03b
Show file tree
Hide file tree
Showing 129 changed files with 2,659 additions and 2,345 deletions.
52 changes: 52 additions & 0 deletions .github/workflows/HaxmBuild.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: HAXM build on Windows, macOS and Linux

on: [push, pull_request]

env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: .
BUILD_CONFIGURATION: Release

jobs:
my_first_job:
name: Windows build
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Install related pkg
run: |
choco install -y nuget.commandline
choco install -y windowsdriverkit10
choco install -y windows-sdk-8.1
- name: Build
run: |
cd platforms/windows
nuget restore
msbuild haxm.sln /p:Configuration="Debug" /p:Platform="Win32"
msbuild haxm.sln /p:Configuration="Debug" /p:Platform="x64"
./build/tests/x64/Debug/haxm-tests.exe
my_second_job:
name: macOS build
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: macOS build
run: |
brew install nasm
cd platforms/darwin
xcodebuild -configuration Debug -sdk macosx ARCHS=x86_64
my_third_job:
name: Linux build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Linux build on Ubuntu
shell: bash
run: |
wget -P /tmp/downloads http://mirrors.kernel.org/ubuntu/pool/universe/n/nasm/nasm_2.13.02-0.1_amd64.deb
sudo apt-get install -y dpkg
sudo dpkg -i /tmp/downloads/nasm_2.13.02-0.1_amd64.deb
cd platforms/linux
make
77 changes: 0 additions & 77 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions CheckTool/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
<key>NSHumanReadableCopyright</key>
<string>&#xA9; 2020 Intel Corporation</string>
<key>CFBundleGetInfoString</key>
<string>Intel&#xAE; HAXM Check Tool 1.0.0</string>
<string>Intel&#xAE; HAXM Check Tool 1.1.0</string>
<key>CFBundleLongVersionString</key>
<string>1.0.0.0</string>
<string>1.1.0.0</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<string>1.1.0</string>
</dict>
</plist>
6 changes: 3 additions & 3 deletions CheckTool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ available [here][checktool-release].
### Usage

1. `cd X:\path\to\CheckTool`
1. `checktool.exe --verbose`
1. `checktool.exe`

The output will be as below.

Expand Down Expand Up @@ -98,7 +98,7 @@ be omitted.
### Usage

1. `cd /path/to/CheckTool`
1. `./checktool --verbose`
1. `./checktool`

### Build

Expand Down Expand Up @@ -126,7 +126,7 @@ below.
| `cmake -DCMAKE_BUILD_TYPE=Release -B build/Release`
| `make -C build/Release`

[checktool-release]: https://github.com/intel/haxm/releases/tag/checktool-v1.0.0
[checktool-release]: https://github.com/intel/haxm/releases/tag/checktool-v1.1.0
[cmake]: https://cmake.org/download/
[install-on-macos]:
https://github.com/intel/haxm/wiki/Installation-Instructions-on-macOS
Expand Down
51 changes: 25 additions & 26 deletions CheckTool/common.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,49 +37,48 @@
namespace haxm {
namespace check_util {

CheckResult ParseArguments(int &argc, char* argv[], bool &is_verbose) {
haxm::check_util::ArgParser arg_parser(argc, argv, {"-h", "--help", "-v",
"--verbose"});
CheckResult ParseArguments(int &argc, char* argv[]) {
CheckResult res = kPass;
ArgParser arg_parser(argc, argv, {"-h", "--help", "-v", "--version"});

if (!arg_parser.Verify()) {
std::cout << "checktool unknown option: " << arg_parser.error()
<< std::endl;
std::cout << "Usage: checktool [-h | --help] [-v | --verbose]"
std::cout << "Usage: checktool [-h | --help] [-v | --version]"
<< std::endl;
return haxm::check_util::kError;
return kError;
}

if (arg_parser.Test("-h") || arg_parser.Test("--help")) {
std::cout << "CheckTool version " << APP_VERSION << std::endl;
std::cout << "-v, --verbose Show detailed system information"
<< std::endl;
return haxm::check_util::kFail;
if (arg_parser.Test("-v") || arg_parser.Test("--version")) {
std::cout << "checktool " << APP_VERSION << std::endl;
std::cout << APP_COPYRIGHT << std::endl;

res = kFail;
}

if (arg_parser.Test("-v") || arg_parser.Test("--verbose")) {
is_verbose = true;
if (arg_parser.Test("-h") || arg_parser.Test("--help")) {
std::cout << "Usage: checktool [-v | --version]" << std::endl;
std::cout << "Check system environment for HAXM." << std::endl;
std::cout << "'*' means passed, while '-' means failed." << std::endl;

res = kFail;
}

return haxm::check_util::kPass;
return res;
}

int Check(bool is_verbose) {
int ret = 0;

haxm::check_util::FeatureDetector fd;
haxm::check_util::CheckResult detect_res = fd.Detect();
int Check() {
FeatureDetector fd;

if (detect_res == haxm::check_util::kError) {
ret = -1;
} else if (detect_res == haxm::check_util::kFail) {
ret = 1;
if (fd.Detect() == kError) {
std::cout << "The handle is invalid or the system command is executed "
"exceptionally." << std::endl;
return -1;
}

if (is_verbose) {
fd.Print();
}
fd.Print();

return ret;
return fd.status();
}

} // namespace check_util
Expand Down
8 changes: 5 additions & 3 deletions CheckTool/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,16 @@
namespace haxm {
namespace check_util {

#define APP_VERSION "1.0.0"
#define APP_VERSION "1.1.0"
#define APP_COPYRIGHT "Copyright (C) 2020 Intel Corporation"

enum CheckResult {
kUnknown = 0,
kPass,
kFail,
kNotApplicable, // e.g., CheckHypervDisabled() on macOS
kError,
kMaxResult
};

// Source:
Expand All @@ -52,8 +54,8 @@ inline static bool IsBitSet(uint32_t reg, int bit) {
return (reg >> bit) & 0x1;
}

CheckResult ParseArguments(int &argc, char* argv[], bool &is_verbose);
int Check(bool is_verbose);
CheckResult ParseArguments(int &argc, char* argv[]);
int Check();

} // namespace check_util
} // namespace haxm
Expand Down
Loading

0 comments on commit cb8f03b

Please sign in to comment.