Summary:
Around a third of our test sources have LLVM license headers. This patch removes those headers from all test
sources and also fixes any tests that depended on the length of the license header.
The reasons for this are:
* A few tests verify line numbers and will start failing if the number of lines in the LLVM license header changes. Once I landed my patch for valid SourceLocations in debug info we will probably have even more tests that verify line numbers.
* No other LLVM project is putting license headers in its test files to my knowledge.
* They make the test sources much more verbose than they have to be. Several tests have longer license headers than the actual test source.
For the record, the following tests had their line numbers changed to pass with the removal of the license header:
lldb-api :: functionalities/breakpoint/breakpoint_by_line_and_column/TestBreakpointByLineAndColumn.py
lldb-shell :: Reproducer/TestGDBRemoteRepro.test
lldb-shell :: Reproducer/TestMultipleTargets.test
lldb-shell :: Reproducer/TestReuseDirectory.test
lldb-shell :: ExecControl/StopHook/stop-hook-threads.test
lldb-shell :: ExecControl/StopHook/stop-hook.test
lldb-api :: lang/objc/exceptions/TestObjCExceptions.py
Reviewers: #lldb, espindola, JDevlieghere
Reviewed By: #lldb, JDevlieghere
Subscribers: emaste, aprantl, arphaman, JDevlieghere, lldb-commits
Tags: #lldb
Differential Revision: https://reviews.llvm.org/D74839
67 lines
1.9 KiB
C++
67 lines
1.9 KiB
C++
#include <cstdlib>
|
|
#include <string>
|
|
#include <fstream>
|
|
#include <iostream>
|
|
|
|
int numberfn()
|
|
{
|
|
return 0x5a;
|
|
}
|
|
|
|
int
|
|
main(int argc, char const *argv[])
|
|
{
|
|
// The program writes its output to the following file:
|
|
//
|
|
// o "output1.txt" for test_pass_host_env_vars() test case
|
|
// o "output2.txt" for test_run_args_and_env_vars_with_dsym() test case
|
|
// o "output2.txt" for test_run_args_and_env_vars_with_dwarf() test case
|
|
std::ofstream outfile;
|
|
if (argc == 1)
|
|
outfile.open("output1.txt");
|
|
else
|
|
outfile.open("output2.txt");
|
|
|
|
for (unsigned i = 0; i < argc; ++i) {
|
|
std::string theArg(argv[i]);
|
|
if (i == 1 && "A" == theArg)
|
|
outfile << "argv[1] matches\n";
|
|
|
|
if (i == 2 && "B" == theArg)
|
|
outfile << "argv[2] matches\n";
|
|
|
|
if (i == 3 && "C" == theArg)
|
|
outfile << "argv[3] matches\n";
|
|
}
|
|
|
|
// For passing environment vars from the debugger to the launched process.
|
|
if (::getenv("MY_ENV_VAR")) {
|
|
std::string MY_ENV_VAR(getenv("MY_ENV_VAR"));
|
|
if ("YES" == MY_ENV_VAR) {
|
|
outfile << "Environment variable 'MY_ENV_VAR' successfully passed.\n";
|
|
}
|
|
}
|
|
|
|
|
|
// For passing host environment vars to the launched process.
|
|
if (::getenv("MY_HOST_ENV_VAR1")) {
|
|
std::string MY_HOST_ENV_VAR1(getenv("MY_HOST_ENV_VAR1"));
|
|
if ("VAR1" == MY_HOST_ENV_VAR1) {
|
|
outfile << "The host environment variable 'MY_HOST_ENV_VAR1' successfully passed.\n";
|
|
}
|
|
}
|
|
|
|
if (::getenv("MY_HOST_ENV_VAR2")) {
|
|
std::string MY_HOST_ENV_VAR2(getenv("MY_HOST_ENV_VAR2"));
|
|
if ("VAR2" == MY_HOST_ENV_VAR2) {
|
|
outfile << "The host environment variable 'MY_HOST_ENV_VAR2' successfully passed.\n";
|
|
}
|
|
}
|
|
|
|
std::cerr << "This message should go to standard error.\n";
|
|
std::cout << "This message should go to standard out.\n";
|
|
|
|
outfile.close();
|
|
return numberfn();
|
|
}
|